Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return(false);
            }
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (obj.GetType() != GetType())
            {
                return(false);
            }

            var value = obj as AllObjectCollections;

            if (value == null)
            {
                return(false);
            }

            return
                (Prop0 != null && value.Prop0 != null &&
                 Prop0.Equals(value.Prop0) &&
                 Prop1 != null && value.Prop1 != null &&
                 Prop1.Equals(value.Prop1) &&
                 Prop2 != null && value.Prop2 != null &&
                 Prop2.Equals(value.Prop2) &&
                 Prop3 != null && value.Prop3 != null &&
                 Prop3.Equals(value.Prop3) &&
                 Prop4 != null && value.Prop4 != null &&
                 Prop4.Equals(value.Prop4) &&
                 Prop5 != null && value.Prop5 != null &&
                 Prop5.Equals(value.Prop5) &&
                 Prop6 != null && value.Prop6 != null &&
                 Prop6.Equals(value.Prop6) &&
                 Prop7 != null && value.Prop7 != null &&
                 Prop7.Equals(value.Prop7) &&
                 Prop8 != null && value.Prop8 != null &&
                 Prop8.Equals(value.Prop8) &&
                 Prop9 != null && value.Prop9 != null &&
                 Prop9.Equals(value.Prop9) &&
                 Prop10 != null && value.Prop10 != null &&
                 Prop10.Equals(value.Prop10) &&
                 Prop11 != null && value.Prop11 != null &&
                 Prop11.Equals(value.Prop11));
        }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            unchecked
            {
                // Choose large primes to avoid hashing collisions
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ Prop0.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop1.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop2.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop3.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop4.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop5.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop6.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop7.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop8.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop9.GetHashCode();
                return(hash);
            }
        }
Exemplo n.º 3
0
        public override int GetHashCode()
        {
            unchecked
            {
                // Choose large primes to avoid hashing collisions
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop0) ? Prop0.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop1) ? Prop1.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop2) ? Prop2.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop3) ? Prop3.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop4) ? Prop4.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop5) ? Prop5.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop6) ? Prop6.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop7) ? Prop7.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop8) ? Prop8.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop9) ? Prop9.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop10) ? Prop10.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop11) ? Prop11.GetHashCode() : 0);
                return(hash);
            }
        }
Exemplo n.º 4
0
 public override string ToString()
 {
     var ptx1 = Point1X.ToString("0.00000").PadLeft(14);
     var pty1 = Point1Y.ToString("0.00000").PadLeft(14);
     var ptx2 = Point2X.ToString("0.00000").PadLeft(14);
     var pty2 = Point2Y.ToString("0.00000").PadLeft(14);
     var angle = Angle.ToString("0.00000").PadLeft(14);
     return $"{Color.ToString().PadLeft(6)}{Prop2.ToString().PadLeft(6)}{Prop3.ToString().PadLeft(6)}{Prop4.ToString().PadLeft(6)}{Prop5.ToString().PadLeft(6)}{Prop6.ToString().PadLeft(6)}{Type.ToString().PadLeft(6)}{Direction.ToString().PadLeft(6)}{ptx1}{pty1}{ptx2}{pty2}{angle}";
 }