当前位置: 首页>>代码示例>>C#>>正文


C# CodeAttributeDeclarationCollection.AddRange方法代码示例

本文整理汇总了C#中System.CodeDom.CodeAttributeDeclarationCollection.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# CodeAttributeDeclarationCollection.AddRange方法的具体用法?C# CodeAttributeDeclarationCollection.AddRange怎么用?C# CodeAttributeDeclarationCollection.AddRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.CodeDom.CodeAttributeDeclarationCollection的用法示例。


在下文中一共展示了CodeAttributeDeclarationCollection.AddRange方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddMemberAttributes

 public void AddMemberAttributes(XmlName messageName, MessagePartDescription part, CodeAttributeDeclarationCollection importedAttributes, CodeAttributeDeclarationCollection typeAttributes, CodeAttributeDeclarationCollection fieldAttributes)
 {
     if (importedAttributes != null)
         fieldAttributes.AddRange(importedAttributes);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:5,代码来源:XmlSerializerOperationGenerator.cs

示例2: AddRange_Self

		public void AddRange_Self ()
		{
			CodeAttributeDeclarationCollection coll = new CodeAttributeDeclarationCollection ();
			coll.Add (new CodeAttributeDeclaration ());
			Assert.AreEqual (1, coll.Count, "#1");
			coll.AddRange (coll);
			Assert.AreEqual (2, coll.Count, "#2");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:CodeAttributeDeclarationCollectionTest.cs

示例3: AddRange_Null_Collection

		public void AddRange_Null_Collection ()
		{
			CodeAttributeDeclarationCollection coll = new CodeAttributeDeclarationCollection ();
			coll.AddRange ((CodeAttributeDeclarationCollection) null);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:5,代码来源:CodeAttributeDeclarationCollectionTest.cs

示例4: AddRange_Null_Item

		public void AddRange_Null_Item ()
		{
			CodeAttributeDeclarationCollection coll = new CodeAttributeDeclarationCollection ();
			coll.AddRange (new CodeAttributeDeclaration[] { null });
		}
开发者ID:nlhepler,项目名称:mono,代码行数:5,代码来源:CodeAttributeDeclarationCollectionTest.cs

示例5: AddRange

		public void AddRange ()
		{
			CodeAttributeDeclaration cad1 = new CodeAttributeDeclaration ();
			CodeAttributeDeclaration cad2 = new CodeAttributeDeclaration ();
			CodeAttributeDeclaration cad3 = new CodeAttributeDeclaration ();

			CodeAttributeDeclarationCollection coll1 = new CodeAttributeDeclarationCollection ();
			coll1.Add (cad1);
			coll1.Add (cad2);

			CodeAttributeDeclarationCollection coll2 = new CodeAttributeDeclarationCollection ();
			coll2.Add (cad3);
			coll2.AddRange (coll1);
			Assert.AreEqual (3, coll2.Count, "#1");
			Assert.AreEqual (1, coll2.IndexOf (cad1), "#2");
			Assert.AreEqual (2, coll2.IndexOf (cad2), "#3");
			Assert.AreEqual (0, coll2.IndexOf (cad3), "#4");

			CodeAttributeDeclarationCollection coll3 = new CodeAttributeDeclarationCollection ();
			coll3.Add (cad3);
			coll3.AddRange (new CodeAttributeDeclaration[] { cad1, cad2 });
			Assert.AreEqual (3, coll2.Count, "#5");
			Assert.AreEqual (1, coll2.IndexOf (cad1), "#6");
			Assert.AreEqual (2, coll2.IndexOf (cad2), "#7");
			Assert.AreEqual (0, coll2.IndexOf (cad3), "#8");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:26,代码来源:CodeAttributeDeclarationCollectionTest.cs

示例6: Constructor1_Deny_Unrestricted

		public void Constructor1_Deny_Unrestricted ()
		{
			CodeAttributeDeclarationCollection coll = new CodeAttributeDeclarationCollection (array);
			coll.CopyTo (array, 0);
			Assert.AreEqual (1, coll.Add (cad), "Add");
			Assert.AreSame (cad, coll[0], "this[int]");
			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);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:13,代码来源:CodeAttributeDeclarationCollectionCas.cs


注:本文中的System.CodeDom.CodeAttributeDeclarationCollection.AddRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。