本文整理汇总了C#中ProjectNode.AddItem方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectNode.AddItem方法的具体用法?C# ProjectNode.AddItem怎么用?C# ProjectNode.AddItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectNode
的用法示例。
在下文中一共展示了ProjectNode.AddItem方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestAddItem
public void TestAddItem()
{
ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
string itemName = "item1.cs";
projectNode.AddItem(itemName);
string fullItemName = new FileInfo(itemName).FullName;
Assert.IsTrue(project.Children.Contains(fullItemName));
}
示例2: AddItemWithInvalidNameThrows
public void AddItemWithInvalidNameThrows()
{
ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
string itemName = "Invalid<Name>";
projectNode.AddItem(itemName);
}
示例3: AddItemWithEmptyNameThrows
public void AddItemWithEmptyNameThrows()
{
ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
string itemName = ".cs";
string fullItemName = new FileInfo(itemName).FullName;
projectNode.AddItem(itemName);
}
示例4: TestGetMSBuildItem
public void TestGetMSBuildItem()
{
ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
string itemName = "item1.cs";
Assert.IsNotNull(projectNode.AddItem(itemName));
Assert.IsNotNull(projectNode.GetBuildItem(itemName));
string itemName2 = ".\\item2.cs";
Assert.IsNotNull(projectNode.AddItem(itemName2));
Assert.IsNotNull(projectNode.GetBuildItem(itemName2));
string itemName3 = ".\\FolderForItem3\\item3.cs";
Assert.IsNotNull(projectNode.AddItem(itemName3));
Assert.IsNotNull(projectNode.GetBuildItem(itemName3));
string itemName4 = "FolderForItem4\\item4.cs";
Assert.IsNotNull(projectNode.AddItem(itemName4));
Assert.IsNotNull(projectNode.GetBuildItem(itemName4));
}
示例5: TestOpenItem
public void TestOpenItem()
{
ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
string itemName = "item1.cs";
HierarchyNode item = projectNode.AddItem(itemName);
IVsWindowFrame wnd = projectNode.OpenItem(item);
Assert.IsNotNull(wnd);
}
示例6: AddItemWithNullNameThrows
public void AddItemWithNullNameThrows()
{
ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
projectNode.AddItem(null);
}