Esempio n. 1
0
        Add <T>(System.Collections.Generic.ICollection <T> list, T value)
        {
            // Imitate the return value in the Java method.
            var wasAdded = !list.Contains(value);

            list.Add(value);
            return(wasAdded);
        }
Esempio n. 2
0
        Remove <T>(System.Collections.Generic.ICollection <T> collection, T entry)
        {
            // Imitate Java List.remove.
            bool hadValue = collection.Contains(entry);

            collection.Remove(entry);
            return(hadValue);
        }
        static StackObject *Contains_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @item = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.ICollection <System.Int32> instance_of_this_method = (System.Collections.Generic.ICollection <System.Int32>) typeof(System.Collections.Generic.ICollection <System.Int32>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Contains(@item);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Esempio n. 4
0
 public bool Contains(object @object)
 {
     return(collection.Contains((T)@object));
 }
Esempio n. 5
0
 Contains <T>(T x, System.Collections.Generic.ICollection <T> collection)
 {
     return(collection.Contains(x));
 }