Example #1
0
 void ICollection <KeyValuePair <TKey, TValue> > .Add(KeyValuePair <TKey, TValue> keyValuePair)
 {
     Add(keyValuePair.Key, keyValuePair.Value);
 }
Example #2
0
 bool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> value)
 {
     // Contract.Ensures(((ICollection<KeyValuePair<TKey, TValue>>)this).Count > 0 || Contract.Result<bool>() == false); // not threadsafe
     return default(bool);
 }
Example #3
0
 bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> value)
 {
     // No information if removal fails.
     return default(bool);
 }
Example #4
0
    static int get_Key(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            System.Collections.Generic.KeyValuePair <uint, Logic.Character.EnemyEntity> obj = (System.Collections.Generic.KeyValuePair <uint, Logic.Character.EnemyEntity>)o;
            uint ret = obj.Key;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Key on a nil value" : e.Message));
        }
    }
Example #5
0
 void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> value)
 {
     //Contract.Ensures(((ICollection<KeyValuePair<TKey, TValue>>)this).Count == Contract.OldValue(((ICollection<KeyValuePair<TKey, TValue>>)this).Count) + 1);  // not threadsafe
 }
Example #6
0
 static int ToString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         System.Collections.Generic.KeyValuePair <uint, Logic.Character.EnemyEntity> obj = (System.Collections.Generic.KeyValuePair <uint, Logic.Character.EnemyEntity>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.KeyValuePair <uint, Logic.Character.EnemyEntity>));
         string o = obj.ToString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #7
0
    static int _CreateSystem_Collections_Generic_KeyValuePair_uint_Logic_Character_EnemyEntity(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                uint arg0 = (uint)LuaDLL.luaL_checknumber(L, 1);
                Logic.Character.EnemyEntity arg1 = (Logic.Character.EnemyEntity)ToLua.CheckUnityObject(L, 2, typeof(Logic.Character.EnemyEntity));
                System.Collections.Generic.KeyValuePair <uint, Logic.Character.EnemyEntity> obj = new System.Collections.Generic.KeyValuePair <uint, Logic.Character.EnemyEntity>(arg0, arg1);
                ToLua.PushValue(L, obj);
                return(1);
            }
            else if (count == 0)
            {
                System.Collections.Generic.KeyValuePair <uint, Logic.Character.EnemyEntity> obj = new System.Collections.Generic.KeyValuePair <uint, Logic.Character.EnemyEntity>();
                ToLua.PushValue(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: System.Collections.Generic.KeyValuePair<uint,Logic.Character.EnemyEntity>.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #8
0
 bool ICollection <KeyValuePair <TKey, TValue> > .Remove(KeyValuePair <TKey, TValue> item)
 {
     throw new NotImplementedException();
 }
Example #9
0
 void ICollection <KeyValuePair <TKey, TValue> > .Add(KeyValuePair <TKey, TValue> item)
 {
     throw new NotImplementedException();
 }
Example #10
0
        void ICollection.CopyTo(Array array, int index)
        {
            if (array == null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array);
            }

            if (array.Rank != 1)
            {
                ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RankMultiDimNotSupported);
            }

            if (array.GetLowerBound(0) != 0)
            {
                ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_NonZeroLowerBound);
            }

            if (index < 0 || index > array.Length)
            {
                ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
            }

            if (array.Length - index < Count)
            {
                ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall);
            }

            KeyValuePair <TKey, TValue>[] pairs = array as KeyValuePair <TKey, TValue>[];
            if (pairs != null)
            {
                CopyTo(pairs, index);
            }
            else if (array is DictionaryEntry[])
            {
                DictionaryEntry[] dictEntryArray = array as DictionaryEntry[];
                Entry[]           entries        = this.entries;
                for (int i = 0; i < count; i++)
                {
                    if (entries[i].hashCode >= 0)
                    {
                        dictEntryArray[index++] = new DictionaryEntry(entries[i].key, entries[i].value);
                    }
                }
            }
            else
            {
                object[] objects = array as object[];
                if (objects == null)
                {
                    ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_InvalidArrayType);
                }

                try
                {
                    int     count   = this.count;
                    Entry[] entries = this.entries;
                    for (int i = 0; i < count; i++)
                    {
                        if (entries[i].hashCode >= 0)
                        {
                            objects[index++] = new KeyValuePair <TKey, TValue>(entries[i].key, entries[i].value);
                        }
                    }
                }
                catch (ArrayTypeMismatchException)
                {
                    ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_InvalidArrayType);
                }
            }
        }