本文整理汇总了C#中System.Web.UI.ControlCollection.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# ControlCollection.Clear方法的具体用法?C# ControlCollection.Clear怎么用?C# ControlCollection.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.ControlCollection
的用法示例。
在下文中一共展示了ControlCollection.Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deny_Unrestricted
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);
}