本文整理汇总了C#中System.CodeDom.CodeExpressionCollection.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# CodeExpressionCollection.Remove方法的具体用法?C# CodeExpressionCollection.Remove怎么用?C# CodeExpressionCollection.Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.CodeDom.CodeExpressionCollection
的用法示例。
在下文中一共展示了CodeExpressionCollection.Remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Constructor0_Deny_Unrestricted
public void Constructor0_Deny_Unrestricted ()
{
CodeExpressionCollection coll = new CodeExpressionCollection ();
Assert.AreEqual (0, coll.Add (ce), "Add");
Assert.AreSame (ce, coll[0], "this[int]");
coll.CopyTo (array, 0);
coll.AddRange (array);
coll.AddRange (coll);
Assert.IsTrue (coll.Contains (ce), "Contains");
Assert.AreEqual (0, coll.IndexOf (ce), "IndexOf");
coll.Insert (0, ce);
coll.Remove (ce);
}
示例2: Remove_NotInCollection
public void Remove_NotInCollection ()
{
CodeExpressionCollection coll = new CodeExpressionCollection ();
coll.Remove (new CodeExpression ());
}
示例3: Remove_Null
public void Remove_Null ()
{
CodeExpressionCollection coll = new CodeExpressionCollection ();
coll.Remove ((CodeExpression) null);
}
示例4: Remove
public void Remove ()
{
CodeExpression ce1 = new CodeExpression ();
CodeExpression ce2 = new CodeExpression ();
CodeExpressionCollection coll = new CodeExpressionCollection ();
coll.Add (ce1);
coll.Add (ce2);
Assert.AreEqual (2, coll.Count, "#1");
Assert.AreEqual (0, coll.IndexOf (ce1), "#2");
Assert.AreEqual (1, coll.IndexOf (ce2), "#3");
coll.Remove (ce1);
Assert.AreEqual (1, coll.Count, "#4");
Assert.AreEqual (-1, coll.IndexOf (ce1), "#5");
Assert.AreEqual (0, coll.IndexOf (ce2), "#6");
}