diff --git a/Documentation/Miscelleaous/ToDo.md b/Documentation/Miscelleaous/ToDo.md index 9fcd6f1..390d64a 100644 --- a/Documentation/Miscelleaous/ToDo.md +++ b/Documentation/Miscelleaous/ToDo.md @@ -7,6 +7,17 @@ i write down the stuff in the fastest way, mostly in note form. ## ToDo +- ToTextTable: bool DeclaredOnly, PropertySortOrder.FromBaseDown / ToBaseUp +- Europe.Germany.RheinlandPfalz.Trier GAdm Generator +- DataSourceAttribute zu den entsprechenden Klassen +- ExampleAttribute weg +- Geometry Rectangle where T: Kilometer, Millimeter or Meter +- IExample und dann in DoofesZeug.Generators ein Namespace Example, die Beispiele heißen dann immer XXXXXExample und implementieren + Examples, aus der TestConsole alles raus. IExample.Execute(TextWriter out). +- Dataset Generate Person: + - auch ein paar Enumerations leer lassen. + - Generate Full or All Features and Basic Features. Action manipulator. +- AssemblyStatisticsGenerator (Namespaces,Classes,Interfaces,Enums) Count, ReferencedAssemblies? - Generate class overview for other classes which are not an entity. - Entities: Genre, Artist, Album, Sampler, Movie, Book. - MarkdownExtension @@ -31,9 +42,6 @@ i write down the stuff in the fastest way, mostly in note form. - Flatten JSON / XML ? - Support für aufruf gnuplot für kleinere Diagramme zwischendurch ? - MatheStuff, z.b geometrische Figuren Rectangle, Circle, und direkt mit ein paar Meßmethoden? -- Generic Singelton Pattern? -- Lazy Load Wrapper? -- Implement Observer Pattern in base class Entity? - VCard support ? - Kleiner einfacher Support für PlantUML? - List To DataTable @@ -42,12 +50,17 @@ i write down the stuff in the fastest way, mostly in note form. - CSV - SQLite - Markdown +- Geht sowas mittles Operatorenüberladung : DataTable["HalfWidth"] = DataTable["Width"] >> 1 - Countries (aus geonames generiert) - Dienstgrade Feuerwehr, Polizei, Militär ## Done +- Remove all GetHashCode implementations. +- ~~Implement Observer Pattern in base class Entity?~~ +- ~~Generic Singelton Pattern?~~ +- ~~Lazy Load Wrapper?~~ - Entites for EMail, Homepage, Phone. - GeoConvert für Lat, Lon und Alt. - ~~StandardValidator als Attribute für EMail, Phone, Name, aber auch ein Interface Validate um komplexere zusammenhänge validieren zu können.~~ diff --git a/DoofesZeug.Library/Src/Datatypes/Misc/UnitPrefix.cs b/DoofesZeug.Library/Src/Datatypes/Misc/UnitPrefix.cs index 823c40a..40d0bb5 100644 --- a/DoofesZeug.Library/Src/Datatypes/Misc/UnitPrefix.cs +++ b/DoofesZeug.Library/Src/Datatypes/Misc/UnitPrefix.cs @@ -90,12 +90,12 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(this.Name, this.Symbol, this.Factor); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(this.Name, this.Symbol, this.Factor); } } diff --git a/DoofesZeug.Library/Src/Entities/DateAndTime/Date.cs b/DoofesZeug.Library/Src/Entities/DateAndTime/Date.cs index 9b7412d..5765e31 100644 --- a/DoofesZeug.Library/Src/Entities/DateAndTime/Date.cs +++ b/DoofesZeug.Library/Src/Entities/DateAndTime/Date.cs @@ -257,13 +257,13 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(this.Day, this.Month, this.Year); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(this.Day, this.Month, this.Year); //------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/DoofesZeug.Library/Src/Entities/DateAndTime/Part/DateTimePart.cs b/DoofesZeug.Library/Src/Entities/DateAndTime/Part/DateTimePart.cs index ec13e2c..e17c5f7 100644 --- a/DoofesZeug.Library/Src/Entities/DateAndTime/Part/DateTimePart.cs +++ b/DoofesZeug.Library/Src/Entities/DateAndTime/Part/DateTimePart.cs @@ -67,12 +67,12 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => this.Value.GetHashCode(); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => this.Value.GetHashCode(); } } diff --git a/DoofesZeug.Library/Src/Entities/DateAndTime/Time.cs b/DoofesZeug.Library/Src/Entities/DateAndTime/Time.cs index f6b0ae8..fff195b 100644 --- a/DoofesZeug.Library/Src/Entities/DateAndTime/Time.cs +++ b/DoofesZeug.Library/Src/Entities/DateAndTime/Time.cs @@ -238,13 +238,13 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(this.Hour, this.Minute, this.Second); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(this.Hour, this.Minute, this.Second); //------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/DoofesZeug.Library/Src/Entities/DateAndTime/UnixTimestamp.cs b/DoofesZeug.Library/Src/Entities/DateAndTime/UnixTimestamp.cs index fb9f9bd..427d963 100644 --- a/DoofesZeug.Library/Src/Entities/DateAndTime/UnixTimestamp.cs +++ b/DoofesZeug.Library/Src/Entities/DateAndTime/UnixTimestamp.cs @@ -153,13 +153,13 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => this.lUnixTimestamp.GetHashCode(); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => this.lUnixTimestamp.GetHashCode(); /// diff --git a/DoofesZeug.Library/Src/Entities/Entity.cs b/DoofesZeug.Library/Src/Entities/Entity.cs index b12e436..08dab38 100644 --- a/DoofesZeug.Library/Src/Entities/Entity.cs +++ b/DoofesZeug.Library/Src/Entities/Entity.cs @@ -19,13 +19,13 @@ public abstract class Entity /// public override abstract bool Equals( object obj ); - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override abstract int GetHashCode(); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override abstract int GetHashCode(); /// diff --git a/DoofesZeug.Library/Src/Entities/IdentifiableEntity.cs b/DoofesZeug.Library/Src/Entities/IdentifiableEntity.cs index 18edec6..d6c9cc4 100644 --- a/DoofesZeug.Library/Src/Entities/IdentifiableEntity.cs +++ b/DoofesZeug.Library/Src/Entities/IdentifiableEntity.cs @@ -24,12 +24,12 @@ public abstract class IdentifiableEntity : Entity public override bool Equals( object obj ) => obj is IdentifiableEntity other && this.Id.Equals(other.Id) != false ; - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => this.Id.GetHashCode(); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => this.Id.GetHashCode(); } } diff --git a/DoofesZeug.Library/Src/Entities/ManMade/Communication/EMailAddress.cs b/DoofesZeug.Library/Src/Entities/ManMade/Communication/EMailAddress.cs index 2483c9b..951b696 100644 --- a/DoofesZeug.Library/Src/Entities/ManMade/Communication/EMailAddress.cs +++ b/DoofesZeug.Library/Src/Entities/ManMade/Communication/EMailAddress.cs @@ -31,13 +31,13 @@ public sealed class EMailAddress : IdentifiableEntity public override string ToString() => this.Address; - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(this.Address, this.InformationType); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(this.Address, this.InformationType); /// diff --git a/DoofesZeug.Library/Src/Entities/ManMade/Communication/Homepage.cs b/DoofesZeug.Library/Src/Entities/ManMade/Communication/Homepage.cs index cd4a6a2..cf9c06a 100644 --- a/DoofesZeug.Library/Src/Entities/ManMade/Communication/Homepage.cs +++ b/DoofesZeug.Library/Src/Entities/ManMade/Communication/Homepage.cs @@ -31,13 +31,13 @@ public sealed class Homepage : IdentifiableEntity public override string ToString() => this.Url.AbsoluteUri; - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(this.Url, this.InformationType); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(this.Url, this.InformationType); /// diff --git a/DoofesZeug.Library/Src/Entities/ManMade/Communication/Phone.cs b/DoofesZeug.Library/Src/Entities/ManMade/Communication/Phone.cs index 26d77b3..580e964 100644 --- a/DoofesZeug.Library/Src/Entities/ManMade/Communication/Phone.cs +++ b/DoofesZeug.Library/Src/Entities/ManMade/Communication/Phone.cs @@ -33,13 +33,13 @@ public sealed class Phone : IdentifiableEntity public override string ToString() => this.Number; - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(this.Number, this.PhoneType, this.InformationType); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(this.Number, this.PhoneType, this.InformationType); /// diff --git a/DoofesZeug.Library/Src/Entities/Science/Base/MetricValueBase.cs b/DoofesZeug.Library/Src/Entities/Science/Base/MetricValueBase.cs index b93d8a2..d07ebf8 100644 --- a/DoofesZeug.Library/Src/Entities/Science/Base/MetricValueBase.cs +++ b/DoofesZeug.Library/Src/Entities/Science/Base/MetricValueBase.cs @@ -142,12 +142,12 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => this.Value.GetHashCode(); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => this.Value.GetHashCode(); } } diff --git a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Altitude.cs b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Altitude.cs index ed68e6e..19831a5 100644 --- a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Altitude.cs +++ b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Altitude.cs @@ -91,13 +91,13 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(this.MeterOverNN); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(this.MeterOverNN); /// diff --git a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/GeoPoint2D.cs b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/GeoPoint2D.cs index 653fc90..dc3d5a5 100644 --- a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/GeoPoint2D.cs +++ b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/GeoPoint2D.cs @@ -73,13 +73,13 @@ public GeoPoint2D( Latitude latitude, Longitude longitude) public override bool Equals( object obj ) => Equals(this, obj as GeoPoint2D); - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(this.Latitude, this.Longitude); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(this.Latitude, this.Longitude); /// diff --git a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/GeoPoint3D.cs b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/GeoPoint3D.cs index d964c65..0c93d46 100644 --- a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/GeoPoint3D.cs +++ b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/GeoPoint3D.cs @@ -76,13 +76,13 @@ public GeoPoint3D( Latitude latitude, Longitude longitude, Altitude altitude ) public override bool Equals( object obj ) => Equals(this, obj as GeoPoint3D); - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(this.Latitude, this.Longitude, this.Altitude); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(this.Latitude, this.Longitude, this.Altitude); /// diff --git a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Latitude.cs b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Latitude.cs index de7ceae..5c26431 100644 --- a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Latitude.cs +++ b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Latitude.cs @@ -104,13 +104,13 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => this.Value.GetHashCode(); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => this.Value.GetHashCode(); /// diff --git a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Longitude.cs b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Longitude.cs index ac3b584..b9d0cbc 100644 --- a/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Longitude.cs +++ b/DoofesZeug.Library/Src/Entities/Science/Geographically/Coordinates/Longitude.cs @@ -104,13 +104,13 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => this.Value.GetHashCode(); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => this.Value.GetHashCode(); /// diff --git a/DoofesZeug.Library/Src/Entities/Specieses/Animals/Animal.cs b/DoofesZeug.Library/Src/Entities/Specieses/Animals/Animal.cs index 5573e4e..9438abb 100644 --- a/DoofesZeug.Library/Src/Entities/Specieses/Animals/Animal.cs +++ b/DoofesZeug.Library/Src/Entities/Specieses/Animals/Animal.cs @@ -36,13 +36,13 @@ public class Animal : Species public override bool Equals( object obj ) => Equals(this, obj as Animal); - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), this.AnimalSpecies, this.Name); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), this.AnimalSpecies, this.Name); /// diff --git a/DoofesZeug.Library/Src/Entities/Specieses/Human/Person.cs b/DoofesZeug.Library/Src/Entities/Specieses/Human/Person.cs index 6154d52..ecce246 100644 --- a/DoofesZeug.Library/Src/Entities/Specieses/Human/Person.cs +++ b/DoofesZeug.Library/Src/Entities/Specieses/Human/Person.cs @@ -72,18 +72,18 @@ public class Person : Species public override bool Equals( object obj ) => Equals(this, obj as Person); - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), - HashCode.Combine(this.FirstName, this.LastName), - HashCode.Combine(this.Handedness, this.BloodGroup), - HashCode.Combine(this.HairColor, this.Religion), - HashCode.Combine(this.Profession, this.DriverLicense, this.AverageHeight, this.AverageWeight), - HashCode.Combine(this.Phone, this.EMailAddress, this.Homepage)); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), + // HashCode.Combine(this.FirstName, this.LastName), + // HashCode.Combine(this.Handedness, this.BloodGroup), + // HashCode.Combine(this.HairColor, this.Religion), + // HashCode.Combine(this.Profession, this.DriverLicense, this.AverageHeight, this.AverageWeight), + // HashCode.Combine(this.Phone, this.EMailAddress, this.Homepage)); /// diff --git a/DoofesZeug.Library/Src/Entities/Specieses/Name.cs b/DoofesZeug.Library/Src/Entities/Specieses/Name.cs index 5959a6a..9e8a186 100644 --- a/DoofesZeug.Library/Src/Entities/Specieses/Name.cs +++ b/DoofesZeug.Library/Src/Entities/Specieses/Name.cs @@ -69,13 +69,13 @@ public override bool Equals( object obj ) } - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => this.Value.GetHashCode(); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => this.Value.GetHashCode(); /// diff --git a/DoofesZeug.Library/Src/Entities/Specieses/Species.cs b/DoofesZeug.Library/Src/Entities/Specieses/Species.cs index f52fb96..978a801 100644 --- a/DoofesZeug.Library/Src/Entities/Specieses/Species.cs +++ b/DoofesZeug.Library/Src/Entities/Specieses/Species.cs @@ -48,13 +48,13 @@ public uint? Age public override bool Equals( object obj ) => Equals(this, obj as Species); - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), this.DateOfBirth, this.Gender, this.DateOfDeath); + ///// + ///// Returns a hash code for this instance. + ///// + ///// + ///// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + ///// + //public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), this.DateOfBirth, this.Gender, this.DateOfDeath); /// diff --git a/DoofesZeug.UnitTests/Src/Formalities/NoGetHashCode.cs b/DoofesZeug.UnitTests/Src/Formalities/NoGetHashCode.cs new file mode 100644 index 0000000..7cd93e0 --- /dev/null +++ b/DoofesZeug.UnitTests/Src/Formalities/NoGetHashCode.cs @@ -0,0 +1,31 @@ +using System; +using System.Reflection; + +using DoofesZeug.Entities; + +using Microsoft.VisualStudio.TestTools.UnitTesting; + + + +namespace DoofesZeug.UnitTests.Formalities +{ + [TestClass] + public class NoGetHashCode + { + [TestMethod] + public void Execute() + { + Type tEntityBase = typeof(Entity); + + Assembly assembly = tEntityBase.Assembly; + + foreach( Type type in assembly.ExportedTypes ) + { + if( type.GetMethod("GetHashCode", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public) != null ) + { + Assert.Fail($"Class {type.FullName} Have An GetHashCode Method!"); + } + } + } + } +}