CopyTo() public méthode

public CopyTo ( Array array, int index ) : void
array System.Array
index int
Résultat void
 static int CopyTo(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         System.Collections.Stack obj  = (System.Collections.Stack)ToLua.CheckObject(L, 1, typeof(System.Collections.Stack));
         System.Array             arg0 = (System.Array)ToLua.CheckObject(L, 2, typeof(System.Array));
         int arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
         obj.CopyTo(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static public int CopyTo(IntPtr l)
 {
     try {
         System.Collections.Stack self = (System.Collections.Stack)checkSelf(l);
         System.Array             a1;
         checkType(l, 2, out a1);
         System.Int32 a2;
         checkType(l, 3, out a2);
         self.CopyTo(a1, a2);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
		public void TestEmptyCopyTo ()
		{
			Stack stack = new Stack ();
			string [] arr = new string [0];
			stack.CopyTo (arr, 0);
		}
Exemple #4
0
 public override void CopyTo(Array array, int arrayIndex)
 {
     lock (_root) {
         _s.CopyTo(array, arrayIndex);
     }
 }
Exemple #5
0
 public override void CopyTo(Array array, int index)
 {
     lock (stack) { stack.CopyTo(array, index); }
 }
    public static void CopyingOutOfRangeThrows_2()
    {
        Stack stack = new Stack();
        stack.Push("MyString");

        var objArr = new Object[0];

        Assert.Throws<ArgumentException>(() => stack.CopyTo(objArr, 0));
    }
    public static void CopyingOutOfRangeThrows_1()
    {
        Stack stack = new Stack();
        var objArr = new Object[0];
        Assert.Throws<ArgumentException>(() => stack.CopyTo(objArr, 1));

        stack = new Stack();
        Assert.Throws<ArgumentException>(() => stack.CopyTo(objArr, Int32.MaxValue));

        stack = new Stack();
        Assert.Throws<ArgumentOutOfRangeException>(() => stack.CopyTo(objArr, Int32.MinValue));

        stack = new Stack();
        Assert.Throws<ArgumentOutOfRangeException>(() => stack.CopyTo(objArr, -1));
    }
 public static void CopyingToMultiDimArrayThrows()
 {
     Stack stack = new Stack();
     stack.Push("hey");
     Assert.Throws<ArgumentException>(() => stack.CopyTo(new Object[8, 8], 0));
 }
 public static void CopyingToNullArrayThrows()
 {
     Stack stack = new Stack();
     stack.Push("hey");
     Assert.Throws<ArgumentNullException>(() => stack.CopyTo(null, 0));
 }
Exemple #10
0
			public void Run(GISADataset CurrentDataSet, GISADataset.NivelRow CurrentNivel, INivelChainVisitor CurrentVisitor)
			{
				Queue PendingNivel = new Queue();
				Stack ContextNivel = new Stack();

				PendingNivel.Enqueue(CurrentNivel);

				CurrentVisitor.InitVisit();

				while (PendingNivel.Count > 0)
				{
					GISADataset.NivelRow CursorNivel = (GISADataset.NivelRow)(PendingNivel.Dequeue());
					if (CursorNivel == null)
					{
						ContextNivel.Pop();
					}
					else
					{
						ContextNivel.Push(CursorNivel);

						GISADataset.NivelRow[] ContextNivelEx = null;
						ContextNivelEx = new GISADataset.NivelRow[ContextNivel.Count];
						ContextNivel.CopyTo(ContextNivelEx, 0);
						CurrentVisitor.Visit(CurrentDataSet, ContextNivelEx);

						foreach (GISADataset.RelacaoHierarquicaRow rhRow in GetNextNivelRows(CurrentDataSet, CursorNivel))
						{
							PendingNivel.Enqueue(rhRow.NivelRowByNivelRelacaoHierarquica);
						}
						PendingNivel.Enqueue(null);
					}
				}

				CurrentVisitor.DoneVisit();
			}