本文整理汇总了C#中ProjectNode类的典型用法代码示例。如果您正苦于以下问题:C# ProjectNode类的具体用法?C# ProjectNode怎么用?C# ProjectNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectNode类属于命名空间,在下文中一共展示了ProjectNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GlobalProjectProperties
public GlobalProjectProperties(ProjectNode project)
{
msBuildProject = project.As<Project>();
dteProject = project.As<EnvDTE.Project>();
vsBuild = project.HierarchyNode.HierarchyIdentity.Hierarchy as IVsBuildPropertyStorage;
accessor = new DynamicPropertyAccessor(this);
}
示例2: TestAcceptsProjectReferenceToItSelf
public void TestAcceptsProjectReferenceToItSelf()
{
ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
int before = project.Children.Count;
projectNode.AddProjectReference(project.GUID);
Assert.AreEqual<int>(before,project.Children.Count);
}
示例3: AddProjectNode
public TreeNode AddProjectNode(ExtTreeView classBrowser, IProject project)
{
ProjectNode prjNode = new ProjectNode(project);
prjNode.AddTo(classBrowser);
classBrowser.Sort();
return prjNode;
}
示例4: SelectParentWillSelectAllChildrenExceptTheDisabledOnes
public void SelectParentWillSelectAllChildrenExceptTheDisabledOnes()
{
// Arrange
ProjectNode[] children = new ProjectNode[3];
// make two children enabled, one disabled
for (int i = 0; i < 3; i++)
{
var project = MockProjectUtility.CreateMockProject("p" + i);
var node = new ProjectNode(project)
{
IsEnabled = i % 2 == 0
};
children[i] = node;
}
var folder = new FolderNode(null, "A", children);
// Act
folder.IsSelected = true;
// Assert
Assert.True(children[0].IsSelected == true);
Assert.True(children[1].IsSelected == false);
Assert.True(children[2].IsSelected == true);
}
示例5: AddItemWithEmptyNameThrows
public void AddItemWithEmptyNameThrows()
{
ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
string itemName = ".cs";
string fullItemName = new FileInfo(itemName).FullName;
projectNode.AddItem(itemName);
}
示例6: TestCanAddItem
public void TestCanAddItem()
{
ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
string itemName = "item1.cs";
Assert.IsTrue(projectNode.CanAddItem(itemName));
string invalidItemName = "<item1>.cs";
Assert.IsFalse(projectNode.CanAddItem(invalidItemName));
}
示例7: 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));
}
示例8: GetReferencesNeedCopy
public IEnumerable<IDependencyNode> GetReferencesNeedCopy(ProjectNode dest)
{
var projectSources = dest.ProjectReferences.Where(r => r.CopyLocal)
.Select(r => (IDependencyNode)r.Node);
var assemblySources = dest.AssemblyReferences.Where(r => r.CopyLocal)
.Select(LoadAssembly);
return projectSources.Concat(assemblySources);
}
示例9: OAProject
public OAProject(ProjectNode project)
{
this.project = project;
if (project is ProjectContainerNode)
{
this.solutionFolder = new Microsoft.VisualStudio.Package.Automation.OASolutionFolder<ProjectContainerNode>((ProjectContainerNode)project);
}
}
示例10: ProjectPropertyIsCorrect
public void ProjectPropertyIsCorrect()
{
// Arrange
var project = MockProjectUtility.CreateMockProject("A");
var node = new ProjectNode(project);
// Act & Assert
Assert.Same(project, node.Project);
}
示例11: IsSelectedFalseByDefault
public void IsSelectedFalseByDefault()
{
// Arrange
var project = MockProjectUtility.CreateMockProject("A");
var node = new ProjectNode(project);
// Act & Assert
Assert.True(node.IsSelected == false);
}
示例12: NamePropertyIsCorrect
public void NamePropertyIsCorrect()
{
// Arrange
var project = MockProjectUtility.CreateMockProject("A");
var node = new ProjectNode(project);
// Act & Assert
Assert.Equal("A", node.Name);
}
示例13: CreateCopyLocalSet
private static CopyLocalSet CreateCopyLocalSet(ProjectNode p, ResolveContext context)
{
return new CopyLocalSet
{
Dest = p,
ProjectCopySource = context.GetProjectReferencesNeedCopy(p).ToArray(),
AssemblyCopySource = context.GetAssemblyReferencesNeedCopy(p).ToArray(),
RuntimeCopySources = context.GetRuntimeReferencesNeedCopy(p).ToArray()
};
}
示例14: ConfigProjectProperties
public ConfigProjectProperties(ProjectNode project, string configName)
{
this.project = project;
this.configName = configName;
vsBuild = project.HierarchyNode.HierarchyIdentity.Hierarchy as IVsBuildPropertyStorage;
if (vsBuild == null)
tracer.Warn(Strings.ConfigProjectProperties.NonMsBuildProject(project.Text));
accessor = new DynamicPropertyAccessor(this);
}
示例15: GetSelectedProjectReturnsEmptyIfIsSelectedIsFalse
public void GetSelectedProjectReturnsEmptyIfIsSelectedIsFalse()
{
// Arrange
var project = MockProjectUtility.CreateMockProject("A");
var node = new ProjectNode(project);
// Act
node.IsSelected = false;
// Assert
Assert.False(node.GetSelectedProjects().Any());
}