Example #1
0
        public bool Equals(Tuple <T1, T2> other)
        {
            if (Item1.Equals(other.Item1))
            {
                return(false);
            }

            return(Item2.Equals(other.Item2));
        }
Example #2
0
 public bool Equals(Segment other)
 {
     if (other == null)
     {
         return(false);
     }
     return(Item1.Equals(other.Item1) && Item2.Equals(other.Item2) ||
            Item1.Equals(other.Item2) && Item2.Equals(other.Item1));
 }
Example #3
0
        public override bool Equals(object obj)
        {
            if (!(obj is Tuple))
            {
                return(false);
            }
            var tuple = (Tuple <T1, T2, T3>)obj;

            return(Item1.Equals(tuple.Item1) && Item2.Equals(tuple.Item2) && Item3.Equals(tuple.Item3));
        }
Example #4
0
        public override bool Equals(object obj)
        {
            var other = obj as Tuple <T1, T2>;

            if (other == null)
            {
                return(false);
            }
            return(Item1.Equals(other.Item1) && Item2.Equals(other.Item2));
        }
Example #5
0
        public override bool Equals(object obj)
        {
            var t = obj as Tuple <T1, T2, T3>;

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

            return(Item1.Equals(t.Item1) && Item2.Equals(t.Item2) && Item3.Equals(t.Item3));
        }
Example #6
0
        public override bool Equals(object obj)
        {
            var p = obj as Pair <T1, T2>;

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

            return(Item1.Equals(p.Item1) && Item2.Equals(p.Item2));
        }
Example #7
0
 public override bool Equals(object obj)
 {
     if (obj == null || (obj as Pair <T1, T2>) == null)        //if the object is null or the cast fails
     {
         return(false);
     }
     else
     {
         Pair <T1, T2> tuple = (Pair <T1, T2>)obj;
         return(Item1.Equals(tuple.Item1) && Item2.Equals(tuple.Item2));
     }
 }
Example #8
0
    public override bool Equals(Object obj)
    {
        // Check for null values and compare run-time types.
        if (obj == null || GetType() != obj.GetType())
        {
            return(false);
        }

        Tuple <T1, T2> tuple = (Tuple <T1, T2>)obj;

        return(Item1.Equals(tuple.Item1) && Item2.Equals(tuple.Item2));
    }
Example #9
0
 public K GetOther(K key)
 {
     if (Item1.Equals(key))
     {
         return(Item2);
     }
     if (Item2.Equals(key))
     {
         return(Item1);
     }
     throw new KeyNotFoundException();
 }
Example #10
0
 public override bool Equals(object obj)
 {
     if (obj == null || (obj as Triple <T1, T2, T3>) == null)        //if the object is null or the cast fails
     {
         return(false);
     }
     else
     {
         Triple <T1, T2, T3> tuple = (Triple <T1, T2, T3>)obj;
         return(Item1.Equals(tuple.Item1) && Item2.Equals(tuple.Item2) && Item3.Equals(tuple.Item3));
     }
 }
Example #11
0
        /// <summary>value equals comparer.</summary>
        /// <param name="other">object to compare to</param>
        /// <returns>true if value equals, else false.</returns>
        public override bool Equals(object other)
        {
            Duple <T1, T2> otherDuple = other as Duple <T1, T2>;

            if (otherDuple != null)
            {
                return(Item1.Equals(otherDuple.Item1) && Item2.Equals(otherDuple.Item2));
            }
            else
            {
                return(base.Equals(other));
            }
        }
Example #12
0
 public override bool Equals(object obj)
 {
     if (obj is DoubleKey)
     {
         DoubleKey other = obj as DoubleKey;
         if (Item1.Equals(other.Item1) && Item2.Equals(other.Item2) ||
             Item1.Equals(other.Item2) && Item2.Equals(other.Item1))
         {
             return(true);
         }
     }
     return(false);
 }
Example #13
0
        public override bool Equals(object obj)
        {
            var other = obj as Tuple <T1, T2>;

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

            bool equals1 = (Item1 != null)? Item1.Equals(other.Item1) : other.Item1 == null;
            bool equals2 = (Item2 != null)? Item2.Equals(other.Item2) : other.Item2 == null;

            return(equals1 && equals2);
        }
Example #14
0
 public bool Contains(object obj)
 {
     if (obj != null)
     {
         if (obj is T1 && Item1.Equals((T1)obj))
         {
             return(true);
         }
         if (obj is T2 && Item2.Equals((T2)obj))
         {
             return(true);
         }
         if (obj is T3 && Item3.Equals((T3)obj))
         {
             return(true);
         }
     }
     return(false);
 }
 public bool Equals(Triple other)
 {
     return(Item1.Equals(other.Item1) && Item2.Equals(other.Item2) && Item3.Equals(other.Item3));
 }
Example #16
0
 public bool Equals(Tuple <T1, T2> tup) => (Item1.Equals(tup.Item1) && Item2.Equals(tup.Item2));
 /// <summary>
 /// Determines if the two items are equal
 /// </summary>
 /// <param name="Item1">Item 1</param>
 /// <param name="Item2">Item 2</param>
 /// <returns>True if they are equal, false otherwise</returns>
 public static bool operator ==(MappingBaseClass <ClassType, DatabaseType> Item1, MappingBaseClass <ClassType, DatabaseType> Item2)
 {
     return(Item1.Equals(Item2));
 }
 public bool Equals(ImmutableTuple <T1> value)
 {
     return(Item1.Equals(value.Item1));
 }
Example #19
0
 public bool Equals(Tuple <T1, T2> other)
 {
     return(Item1.Equals(other.Item1) && Item2.Equals(other.Item2));
 }
Example #20
0
 public bool Contains(K key)
 {
     return(Item1.Equals(key) || Item2.Equals(key));
 }
Example #21
0
 bool IEquatable <UnordererPair <T> > .Equals(UnordererPair <T> other)
 {
     return
         ((Item1.Equals(other.Item1) && Item2.Equals(other.Item2)) ||
          (Item1.Equals(other.Item2) && Item2.Equals(other.Item1)));
 }
Example #22
0
        /// <summary>
        /// Determines whether the given object is equal to this one.
        /// </summary>
        /// <param name="obj">The other object be compared with.</param>
        /// <returns>True if they are equal, false otherwise.</returns>
        public override bool Equals(object obj)
        {
            var other = obj as TownTuple;

            return(other == null ? false : Item1.Equals(other.Item1) && Item2.Equals(other.Item2));
        }
Example #23
0
 /// <summary>
 /// Determines if the two items are equal
 /// </summary>
 /// <param name="Item1">Item 1</param>
 /// <param name="Item2">Item 2</param>
 /// <returns>True if they are equal, false otherwise</returns>
 public static bool operator ==(MappingBaseClass <TClassType, TDatabaseType>?Item1, MappingBaseClass <TClassType, TDatabaseType>?Item2)
 {
     return(Item1?.Equals(Item2) ?? Item2 is null);
 }
Example #24
0
        /// <summary>
        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public override bool Equals(object obj)
        {
            var other = (Tuple <T1, T2>)obj;

            return(Item1.Equals(other.Item1) && Item2.Equals(other.Item2));
        }
Example #25
0
 public bool Equals(ValueTuple <T1, T2, T3> other)
 {
     var(item1, item2, item3) = other;
     return((Item1?.Equals(item1) ?? item1 == null) && (Item2?.Equals(item2) ?? item2 == null) &&
            (Item3?.Equals(item3) ?? item3 == null));
 }