public static Control[] Clone(this ControlCollection c) { var arr_controls = new Control[c.Count]; c.CopyTo(arr_controls, 0); return(arr_controls); }
public void Deny_Unrestricted() { // note: using the same control (as owner) to add results // in killing the ms runtime with a stackoverflow - FDBK36722 ControlCollection cc = new ControlCollection(new Control()); Assert.AreEqual(0, cc.Count, "Count"); Assert.IsFalse(cc.IsReadOnly, "IsReadOnly"); Assert.IsFalse(cc.IsSynchronized, "IsSynchronized"); Assert.IsNotNull(cc.SyncRoot, "SyncRoot"); cc.Add(control); Assert.IsNotNull(cc[0], "this[int]"); cc.Clear(); cc.AddAt(0, control); Assert.IsTrue(cc.Contains(control), "Contains"); cc.CopyTo(new Control[1], 0); Assert.IsNotNull(cc.GetEnumerator(), "GetEnumerator"); Assert.AreEqual(0, cc.IndexOf(control), "IndexOf"); cc.RemoveAt(0); cc.Remove(control); }
public void CopyTo(ReorderListItem[] array, int arrayIndex) { ChildList.CopyTo(array, arrayIndex); }
public void CopyTo(Array array, int index) { cc.CopyTo(array, index); }
public void CopyTo(DigitViewer[] array, int arrayIndex) { controls.CopyTo(array, arrayIndex); }