System.Collections.ArrayList.SetRange C# (CSharp) Method

SetRange() public method

public SetRange ( int index, ICollection c ) : void
index int
c ICollection
return void
        public virtual void SetRange(int index, ICollection c)
        {
            if (c == null) throw new ArgumentNullException(nameof(c), SR.ArgumentNull_Collection);
            Contract.EndContractBlock();
            int count = c.Count;
            if (index < 0 || index > _size - count) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);

            if (count > 0)
            {
                c.CopyTo(_items, index);
                _version++;
            }
        }

Usage Example

Example #1
0
 static int SetRange(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         System.Collections.ArrayList obj = (System.Collections.ArrayList)ToLua.CheckObject(L, 1, typeof(System.Collections.ArrayList));
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         System.Collections.ICollection arg1 = (System.Collections.ICollection)ToLua.CheckObject(L, 3, typeof(System.Collections.ICollection));
         obj.SetRange(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
All Usage Examples Of System.Collections.ArrayList::SetRange