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


C# BuildItemGroup.Clone方法代码示例

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


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

示例1: TestClone2

		public void TestClone2 ()
		{
			BuildItemGroup big = new BuildItemGroup ();
			big.AddNewItem ("a", "a");
			big.AddNewItem ("b", "a");

			BuildItemGroup big2 = big.Clone (true);
			BuildItem[] items = big2.ToArray ();

			Assert.AreEqual (2, big2.Count, "A1");

			Assert.AreEqual (String.Empty, items [0].Condition, "A2");
			Assert.AreEqual (String.Empty, items [0].Exclude, "A3");
			Assert.AreEqual ("a", items [0].FinalItemSpec, "A4");
			Assert.AreEqual ("a", items [0].Include, "A5");
			Assert.IsFalse (items [0].IsImported, "A6");
			Assert.AreEqual ("a", items [0].Name, "A7");
			
			Assert.AreEqual (String.Empty, items [1].Condition, "A8");
			Assert.AreEqual (String.Empty, items [1].Exclude, "A9");
			Assert.AreEqual ("a", items [1].FinalItemSpec, "A10");
			Assert.AreEqual ("a", items [1].Include, "A11");
			Assert.IsFalse (items [1].IsImported, "A12");
			Assert.AreEqual ("b", items [1].Name, "A13");
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:25,代码来源:BuildItemGroupTest.cs

示例2: DeepCloneOfPersistedItemGroup

        public void DeepCloneOfPersistedItemGroup()
        {
            XmlElement ig = CreatePersistedItemGroupElement();
            BuildItemGroup group = new BuildItemGroup(ig, false, new Project());

            BuildItemGroup clone = group.Clone(true);

            Assertion.AssertEquals(2, clone.Count);
            Assert.AreNotEqual(group.ItemGroupElement, clone.ItemGroupElement);
            Assert.AreNotEqual(group.ParentProject, clone.ParentProject);
        }
开发者ID:nikson,项目名称:msbuild,代码行数:11,代码来源:BuildItemGroup_Tests.cs

示例3: ShallowCloneOfVirtualItemGroup

        public void ShallowCloneOfVirtualItemGroup()
        {
            BuildItemGroup group = new BuildItemGroup();
            group.AddNewItem("i", "i1");
            BuildItem i2 = new BuildItem("i", "i2");
            group.AddItem(i2);

            BuildItemGroup group2 = group.Clone(false /*shallow*/);

            Assertion.AssertEquals(2, group2.Count);
            Assertion.AssertEquals("i1", group2[0].FinalItemSpec);
            Assertion.Assert(i2.Equals(group2[1]));
        }
开发者ID:nikson,项目名称:msbuild,代码行数:13,代码来源:BuildItemGroup_Tests.cs

示例4: ShallowCloneOfPersistedItemGroup

        public void ShallowCloneOfPersistedItemGroup()
        {
            XmlElement ig = CreatePersistedItemGroupElement();
            BuildItemGroup group = new BuildItemGroup(ig, false, new Project());

            BuildItemGroup clone = group.Clone(false);
        }
开发者ID:nikson,项目名称:msbuild,代码行数:7,代码来源:BuildItemGroup_Tests.cs


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