当前位置: 首页>>代码示例>>C#>>正文


C# ProjectRootElement.AddItemGroup方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:JannethAmaya,项目名称:RestAPIClientGenerator,代码行数:8,代码来源:ProjectFileGenerator.cs

示例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");

            }
        }
开发者ID:JannethAmaya,项目名称:RestAPIClientGenerator,代码行数:10,代码来源:ProjectFileGenerator.cs

示例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 };
        }
开发者ID:renannprado,项目名称:xnastrategygame,代码行数:39,代码来源:ContentBuilder.cs


注:本文中的Microsoft.Build.Construction.ProjectRootElement.AddItemGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。