本文整理汇总了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");
}
示例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);
}
示例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]));
}
示例4: ShallowCloneOfPersistedItemGroup
public void ShallowCloneOfPersistedItemGroup()
{
XmlElement ig = CreatePersistedItemGroupElement();
BuildItemGroup group = new BuildItemGroup(ig, false, new Project());
BuildItemGroup clone = group.Clone(false);
}