public virtual bool Equals(SelectField<T> obj)
		{
			if (SelectField<T>.op_Equality(obj, null))
			{
				return false;
			}
			return EqualityComparer<T>.get_Default().Equals(this.get_Value(), obj.get_Value());
		}
 public virtual bool Equals(SimpleField <T> obj)
 {
     if (!SimpleField <T> .op_Inequality(obj, null))
     {
         return(false);
     }
     return(EqualityComparer <T> .get_Default().Equals(this.get_Value(), obj.get_Value()));
 }
Beispiel #3
0
 public override bool Match(MatchContext context, object object)
 {
     stackVariable1 = this.get_Comparer();
     if (stackVariable1 == null)
     {
         dummyVar0      = stackVariable1;
         stackVariable1 = EqualityComparer <object> .get_Default();
     }
     return(stackVariable1.Equals(this.get_Value(), object));
 }
Beispiel #4
0
        bool ICollection <KeyValuePair <TKey, TValue> > .Remove(KeyValuePair <TKey, TValue> item)
        {
            TValue tValue;

            if (this.TryGetValue(item.get_Key(), out tValue) && EqualityComparer <TValue> .get_Default().Equals(tValue, item.get_Value()))
            {
                this.Remove(item.get_Key());
                return(true);
            }
            return(false);
        }
Beispiel #5
0
 public bool Remove(T item)
 {
     for (int i = 0; i < this._size; i++)
     {
         if (EqualityComparer <T> .get_Default().Equals(this._items[i].Value, item))
         {
             this.RemoveAt(i);
             return(true);
         }
     }
     return(false);
 }
Beispiel #6
0
 public override bool Match(MatchContext context, object object)
 {
     if (!context.TryGetData(this.get_Name(), out V_0))
     {
         return(false);
     }
     stackVariable6 = this.get_Comparer();
     if (stackVariable6 == null)
     {
         dummyVar0      = stackVariable6;
         stackVariable6 = EqualityComparer <object> .get_Default();
     }
     return(stackVariable6.Equals(V_0, object));
 }
Beispiel #7
0
        public bool ContainsValue(TValue value)
        {
            IEqualityComparer <TValue> @default = EqualityComparer <TValue> .get_Default();

            for (int i = 0; i < this.table.Length; i++)
            {
                for (int num = this.table[i] - 1; num != -1; num = this.linkSlots[num].Next)
                {
                    if (@default.Equals(this.valueSlots[num], value))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
        public static bool ListEquals <T>(IList <T> a, IList <T> b)
        {
            if (a == null || b == null)
            {
                return(a == null && b == null);
            }
            if (a.get_Count() != b.get_Count())
            {
                return(false);
            }
            EqualityComparer <T> @default = EqualityComparer <T> .get_Default();

            for (int i = 0; i < a.get_Count(); i++)
            {
                if ([email protected](a.get_Item(i), b.get_Item(i)))
                {
                    return(false);
                }
            }
            return(true);
        }
 public static bool ContainsValue <TSource>(this IEnumerable <TSource> source, TSource value, IEqualityComparer <TSource> comparer)
 {
     if (comparer == null)
     {
         comparer = EqualityComparer <TSource> .get_Default();
     }
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     using (IEnumerator <TSource> enumerator = source.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             TSource current = enumerator.get_Current();
             if (comparer.Equals(current, value))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #10
0
 public BidirectionalDictionary() : this(EqualityComparer <TFirst> .get_Default(), EqualityComparer <TSecond> .get_Default())
 {
 }
Beispiel #11
0
 private void Init(int capacity, IEqualityComparer <TKey> hcp)
 {
     this.hcp = (hcp ?? EqualityComparer <TKey> .get_Default());
     capacity = Math.Max(1, (int)((float)capacity / 0.9f));
     this.InitArrays(capacity);
 }
 public static bool AddRangeDistinct <T>(this IList <T> list, IEnumerable <T> values)
 {
     return(list.AddRangeDistinct(values, EqualityComparer <T> .get_Default()));
 }
 public bool Equals(TimeInterval <T> other)
 {
     return(other.Interval.Equals(this.Interval) && EqualityComparer <T> .get_Default().Equals(this.Value, other.Value));
 }
 public static bool AddDistinct <T>(this IList <T> list, T value)
 {
     return(list.AddDistinct(value, EqualityComparer <T> .get_Default()));
 }
 public bool Equals(Timestamped <T> other)
 {
     return(other.Timestamp.Equals(this.Timestamp) && EqualityComparer <T> .get_Default().Equals(this.Value, other.Value));
 }
 public override bool Equals(Notification <T> other)
 {
     return(object.ReferenceEquals(this, other) || (!object.ReferenceEquals(other, null) && other.Kind == NotificationKind.OnNext && EqualityComparer <T> .get_Default().Equals(this.Value, other.Value)));
 }
 public override int GetHashCode()
 {
     return(EqualityComparer <T> .get_Default().GetHashCode(this.Value));
 }
 public static int IndexOf <TSource>(this IEnumerable <TSource> list, TSource value) where TSource : IEquatable <TSource>
 {
     return(list.IndexOf(value, EqualityComparer <TSource> .get_Default()));
 }