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