本文整理汇总了C#中Microsoft.Build.Construction.ProjectRootElement.AddItemGroup方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectRootElement.AddItemGroup方法的具体用法?C# ProjectRootElement.AddItemGroup怎么用?C# ProjectRootElement.AddItemGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.Construction.ProjectRootElement
的用法示例。
在下文中一共展示了ProjectRootElement.AddItemGroup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddItems
private static void AddItems(ProjectRootElement elem, string groupName, params string[] items)
{
var group = elem.AddItemGroup();
foreach (var item in items)
{
group.AddItem(groupName, item);
}
}
示例2: AddItemsWithLocation
private static void AddItemsWithLocation(ProjectRootElement elem, string groupName, params string[] items)
{
var group = elem.AddItemGroup();
foreach (var item in items)
{
ProjectItemElement element = group.AddItem(groupName, item);
element.AddMetadata("HintPath", @"C:\" + item + ".dll");
}
}
示例3: CreateBuildProject
/// <summary>
/// Creates a temporary MSBuild content project in memory.
/// </summary>
void CreateBuildProject()
{
string projectPath = Path.Combine(buildDirectory, "content.contentproj");
string outputPath = Path.Combine(buildDirectory, "bin");
// Create the build project.
projectRootElement = ProjectRootElement.Create(projectPath);
// Include the standard targets file that defines how to build XNA Framework content.
projectRootElement.AddImport("$(MSBuildExtensionsPath)\\Microsoft\\XNA Game Studio\\" +
"v4.0\\Microsoft.Xna.GameStudio.ContentPipeline.targets");
buildProject = new Project(projectRootElement);
ProjectItemGroupElement teste = projectRootElement.AddItemGroup();
teste.AddItem("ProjectReference", @"C:\Users\Renann\Desktop\StrategyGame\StrategyGameLibrary\StrategyGameLibrary.csproj");
buildProject.SetProperty("XnaPlatform", "Windows");
buildProject.SetProperty("XnaProfile", "Reach");
buildProject.SetProperty("XnaFrameworkVersion", "v4.0");
buildProject.SetProperty("Configuration", "Release");
buildProject.SetProperty("OutputPath", outputPath);
// Register any custom importers or processors.
foreach (string pipelineAssembly in pipelineAssemblies)
{
buildProject.AddItem("Reference", pipelineAssembly);
}
// Hook up our custom error logger.
errorLogger = new ErrorLogger();
buildParameters = new BuildParameters(ProjectCollection.GlobalProjectCollection);
buildParameters.Loggers = new ILogger[] { errorLogger };
}