本文整理汇总了C#中IProject.GetItemsOfType方法的典型用法代码示例。如果您正苦于以下问题:C# IProject.GetItemsOfType方法的具体用法?C# IProject.GetItemsOfType怎么用?C# IProject.GetItemsOfType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProject
的用法示例。
在下文中一共展示了IProject.GetItemsOfType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsServiceReferencesFolder
public static bool IsServiceReferencesFolder(IProject project, string folder)
{
foreach (ProjectItem item in project.GetItemsOfType(ItemType.ServiceReferences)) {
var serviceReferenceProjectItem = (ServiceReferencesProjectItem)item;
if (serviceReferenceProjectItem.IsDirectoryMatch(folder)) {
return true;
}
}
return false;
}
示例2: IsWebReferencesFolder
/// <summary>
/// Determines if the specified <paramref name="folder"/> is a
/// web reference folder in the specified <paramref name="project"/>.
/// </summary>
/// <param name="project">The project.</param>
/// <param name="folder">The full folder path.</param>
public static bool IsWebReferencesFolder(IProject project, string folder)
{
foreach (ProjectItem item in project.GetItemsOfType(ItemType.WebReferences)) {
var webReference = item as WebReferencesProjectItem;
if (webReference.IsDirectoryMatch(folder)) {
return true;
}
}
return false;
}
示例3: GetFilesFromProject
IEnumerable<FileName> GetFilesFromProject(IProject project)
{
if (project == null)
return Enumerable.Empty<FileName>();
return from item in project.GetItemsOfType(ItemType.Compile)
where item.FileName.HasExtension(".cs")
select item.FileName;
}
示例4: ParseMSBuildProject
/// <summary>
/// Adds a ProjectToBuild item for the project and it's project references.
/// Returns the added item, or null if an error occured.
/// </summary>
ProjectToBuild ParseMSBuildProject(IProject project)
{
ProjectToBuild ptb;
if (parseMSBuildProjectProjectsToBuildDict.TryGetValue(project, out ptb)) {
// only add each project once, reuse existing ProjectToBuild
return ptb;
}
ptb = new ProjectToBuild(project.FileName, options.Target.TargetName);
ptb.configuration = parentEngine.Configuration;
ptb.platform = parentEngine.Platform;
projectsToBuild.Add(ptb);
parseMSBuildProjectProjectsToBuildDict[project] = ptb;
foreach (ProjectItem item in project.GetItemsOfType(ItemType.ProjectReference)) {
ProjectReferenceProjectItem prpi = item as ProjectReferenceProjectItem;
if (prpi != null && prpi.ReferencedProject != null) {
ProjectToBuild referencedProject = ParseMSBuildProject(prpi.ReferencedProject);
if (referencedProject == null)
return null;
ptb.dependencies.Add(referencedProject);
}
}
return ptb;
}