本文整理汇总了C#中IVsProject.GetProjectItems方法的典型用法代码示例。如果您正苦于以下问题:C# IVsProject.GetProjectItems方法的具体用法?C# IVsProject.GetProjectItems怎么用?C# IVsProject.GetProjectItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVsProject
的用法示例。
在下文中一共展示了IVsProject.GetProjectItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveModifiedFiles
private void SaveModifiedFiles(IVsProject project) {
// save all the open files in the project...
foreach (var itemPath in project.GetProjectItems()) {
if (String.IsNullOrEmpty(itemPath)) {
continue;
}
var solution = (IVsSolution)_serviceProvider.GetService(typeof(SVsSolution));
ErrorHandler.ThrowOnFailure(
solution.SaveSolutionElement(
0,
(IVsHierarchy)project,
0
)
);
}
}
示例2: FindSources
public IEnumerable<TestContainerSource> FindSources(IVsProject project)
{
var containers = project.GetProjectItems()
.Where(f => TestAdapterInfo.IsTestContainer(f) && File.Exists(f))
.Select(f => new { Path = f, Directory = Path.GetDirectoryName(f), Priority = TestAdapterInfo.GetContainerPriority(f) })
.ToList();
return from c in containers
where !containers.Any(d => PathUtils.PathsEqual(c.Directory, d.Directory) && d.Priority > c.Priority)
select CreateTestContainerSource(project, c.Path);
}