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


C# Project.GetParameters方法代码示例

本文整理汇总了C#中Project.GetParameters方法的典型用法代码示例。如果您正苦于以下问题:C# Project.GetParameters方法的具体用法?C# Project.GetParameters怎么用?C# Project.GetParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Project的用法示例。


在下文中一共展示了Project.GetParameters方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OrderSourceFiles

        /// <summary>
        /// Orders the given set of source files if necessary
        /// </summary>
        /// <param name="project">Project being processed</param>
        /// <param name="files">Input sequence</param>
        /// <returns>Output sequence</returns>
        protected override IEnumerable<SuiteRelativePath> OrderSourceFiles(Project project, IEnumerable<SuiteRelativePath> files)
        {
            if (project.HasParameters("order"))
            {
                var order = project.GetParameters<FsharpFileOrder>("order");
                var remaining = new HashSet<SuiteRelativePath>(files);

                foreach (string file in order.OrderedFiles)
                {
                    var path = new SuiteRelativePath(
                        Path.Combine(Suite.SuiteRoot.GetRelativePath(project.RootDirectory), "fs", file));

                    if (remaining.Contains(path))
                    {
                        remaining.Remove(path);
                        yield return path;
                    }
                }

                foreach (var path in remaining)
                    yield return path;
            }
            else
            {
                foreach (var file in base.OrderSourceFiles(project, files))
                    yield return file;
            }
        }
开发者ID:zvrana,项目名称:bari,代码行数:34,代码来源:SourceItemsSection.cs

示例2: Write

        public override void Write(XmlWriter writer, Project project, IMSBuildProjectGeneratorContext context)
        {
            // TODO: merge common code with C# PropertiesSection

            writer.WriteStartElement("PropertyGroup");
            writer.WriteAttributeString("Condition", " '$(Configuration)|$(Platform)' == 'Bari|Bari' ");
            WriteConfigurationSpecificPart(writer, project);
            writer.WriteEndElement();

            writer.WriteStartElement("PropertyGroup");
            WriteConfigurationSpecificPart(writer, project);
            
            writer.WriteElementString("OutputType", GetOutputType(project.Type));
            writer.WriteElementString("AssemblyName", project.Name);
            writer.WriteElementString("ProjectGuid", projectGuidManagement.GetGuid(project).ToString("B"));

            FsharpProjectParameters parameters = project.HasParameters("fsharp")
                                         ? project.GetParameters<FsharpProjectParameters>("fsharp")
                                         : new FsharpProjectParameters(Suite);

            parameters.FillProjectSpecificMissingInfo(project);
            parameters.ToFsprojProperties(writer);   

            writer.WriteEndElement();
        }
开发者ID:zvrana,项目名称:bari,代码行数:25,代码来源:PropertiesSection.cs

示例3: Write

        /// <summary>
        /// Writes the section using an XML writer
        /// </summary>
        /// <param name="writer">XML writer to use</param>
        /// <param name="project">The project to generate .csproj for</param>
        /// <param name="context">Current .csproj generation context</param>
        public override void Write(XmlWriter writer, Project project, IMSBuildProjectGeneratorContext context)
        {            
            writer.WriteStartElement("PropertyGroup");
            writer.WriteAttributeString("Condition", " '$(Configuration)|$(Platform)' == 'Bari|Bari' ");
            WriteConfigurationSpecificPart(writer, project);
            writer.WriteEndElement();

            writer.WriteStartElement("PropertyGroup");
            
            // Writing out configuration specific part to the non conditional block as well
            WriteConfigurationSpecificPart(writer, project);

            writer.WriteElementString("OutputType", GetOutputType(project.Type));
            writer.WriteElementString("AssemblyName", project.Name);
            writer.WriteElementString("ProjectGuid", projectGuidManagement.GetGuid(project).ToString("B"));

            CsharpProjectParameters parameters = project.HasParameters("csharp")
                                                     ? project.GetParameters<CsharpProjectParameters>("csharp")
                                                     : new CsharpProjectParameters(Suite);

            parameters.FillProjectSpecificMissingInfo(project);
            parameters.ToCsprojProperties(writer);       

            WriteAppConfig(writer, project);
            WriteManifest(writer, project);
            WriteApplicationIcon(writer, project, parameters);

            writer.WriteEndElement();
        }
开发者ID:zvrana,项目名称:bari,代码行数:35,代码来源:PropertiesSection.cs

示例4: PrefixWithRootNamespace

        private string PrefixWithRootNamespace(Project project, string path)
        {
            CsharpProjectParameters parameters = project.HasParameters("csharp")
                                                     ? project.GetParameters<CsharpProjectParameters>("csharp")
                                                     : new CsharpProjectParameters(Suite);
            parameters.FillProjectSpecificMissingInfo(project);

            return parameters.RootNamespace + "." + path;
        }
开发者ID:zvrana,项目名称:bari,代码行数:9,代码来源:EmbeddedResourcesSection.cs

示例5: FillProjectSpecificMissingInfo

        public void FillProjectSpecificMissingInfo(Project project)
        {
            if (project.HasParameters("midl"))
            {
                var midlParams = project.GetParameters<VCppProjectMIDLParameters>("midl");
                TypeLibraryFile = midlParams.TypeLibraryName;         
            }

            ComponentFileName = "$(TargetFileName)";
        }
开发者ID:zvrana,项目名称:bari,代码行数:10,代码来源:VCppProjectManifestParameters.cs

示例6: Write

        public override void Write(XmlWriter writer, Project project, IMSBuildProjectGeneratorContext context)
        {
            if (project.HasParameters("contracts"))
            {
                writer.WriteStartElement("PropertyGroup");

                var parameters = project.GetParameters<ContractsProjectParameters>("contracts");
                parameters.ToCsprojProperties(writer);

                writer.WriteEndElement();
            }
        }
开发者ID:zvrana,项目名称:bari,代码行数:12,代码来源:CodeContractsSection.cs

示例7: GetManifestParameters

        private VCppProjectManifestParameters GetManifestParameters(Project project)
        {
            VCppProjectManifestParameters manifestParameters = project.HasParameters("manifest")
                ? project.GetParameters<VCppProjectManifestParameters>("manifest")
                : new VCppProjectManifestParameters(Suite);

            manifestParameters.FillProjectSpecificMissingInfo(project);
            return manifestParameters;
        }
开发者ID:zvrana,项目名称:bari,代码行数:9,代码来源:PropertiesSection.cs

示例8: WriteLinkerParameters

        private void WriteLinkerParameters(XmlWriter writer, Project project)
        {
            VCppProjectLinkerParameters compilerParameters = project.HasParameters("cpp-linker")
                                                                   ? project.GetParameters<VCppProjectLinkerParameters>("cpp-linker")
                                                                   : new VCppProjectLinkerParameters(Suite);

            compilerParameters.FillProjectSpecificMissingInfo(project);

            writer.WriteStartElement("Link");
            compilerParameters.ToVcxprojProperties(writer);
            writer.WriteEndElement();
        }
开发者ID:zvrana,项目名称:bari,代码行数:12,代码来源:PropertiesSection.cs

示例9: WriteCompilerParameters

        private void WriteCompilerParameters(XmlWriter writer, Project project)
        {
            VCppProjectCompilerParameters compilerParameters = project.HasParameters("cpp-compiler")
                                                                   ? project.GetParameters<VCppProjectCompilerParameters>("cpp-compiler")
                                                                   : new VCppProjectCompilerParameters(Suite);

            compilerParameters.FillProjectSpecificMissingInfo(project, GetCLIMode(project), targetDir as LocalFileSystemDirectory);

            writer.WriteStartElement("ClCompile");
            compilerParameters.ToVcxprojProperties(writer);

            if (project.GetSourceSet("cpp").Files.Any(file => Path.GetFileName(file) == "stdafx.cpp"))
                writer.WriteElementString("PrecompiledHeader", "Use");

            writer.WriteEndElement();
        }
开发者ID:zvrana,项目名称:bari,代码行数:16,代码来源:PropertiesSection.cs

示例10: WriteMIDLParameters

        private void WriteMIDLParameters(XmlWriter writer, Project project)
        {
            VCppProjectMIDLParameters midlParameters = project.HasParameters("midl")
                                                                   ? project.GetParameters<VCppProjectMIDLParameters>("midl")
                                                                   : new VCppProjectMIDLParameters(Suite);

            midlParameters.FillProjectSpecificMissingInfo(project, targetDir as LocalFileSystemDirectory);

            writer.WriteStartElement("Midl");
            midlParameters.ToVcxprojProperties(writer);
            writer.WriteEndElement();
        }
开发者ID:zvrana,项目名称:bari,代码行数:12,代码来源:PropertiesSection.cs

示例11: GetCLIMode

        private CppCliMode GetCLIMode(Project project)
        {
            VCppProjectCLIParameters cliParameters = project.HasParameters("cli")
                ? project.GetParameters<VCppProjectCLIParameters>("cli")
                : new VCppProjectCLIParameters();

            return cliParameters.Mode;
        }
开发者ID:zvrana,项目名称:bari,代码行数:8,代码来源:PropertiesSection.cs

示例12: GetUseOfAtl

        private string GetUseOfAtl(Project project)
        {
            VCppProjectATLParameters atlParameters = project.HasParameters("atl")
                ? project.GetParameters<VCppProjectATLParameters>("atl")
                : new VCppProjectATLParameters();

            switch (atlParameters.UseOfATL)
            {
                case UseOfATL.None:
                    return String.Empty;
                case UseOfATL.Static:
                    return "Static";
                case UseOfATL.Dynamic:
                    return "Dynamic";
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
开发者ID:zvrana,项目名称:bari,代码行数:18,代码来源:PropertiesSection.cs

示例13: IsWPFApplicationDefinition

        private bool IsWPFApplicationDefinition(Project project, string file)
        {
            var relativePath = ToProjectRelativePath(project, file, ProjectSourceSetName);

            if (project.HasParameters("wpf"))
            {
                var wpfParameters = project.GetParameters<WPFParameters>("wpf");
                return relativePath.Equals(wpfParameters.ApplicationDefinition, StringComparison.InvariantCultureIgnoreCase);
            }

            return false;
        }
开发者ID:zvrana,项目名称:bari,代码行数:12,代码来源:SourceItemsSection.cs

示例14: WPFParametersDependencies

 public WPFParametersDependencies(Project project)
 {
     wpfParameters = project.GetParameters<WPFParameters>("wpf");
 }
开发者ID:zvrana,项目名称:bari,代码行数:4,代码来源:WPFParametersDependencies.cs

示例15: ProjectParametersDependencies

 protected ProjectParametersDependencies(Project project, string name)
 {
     this.project = project;
     blockName = name;
     parameters = project.GetParameters<IProjectParameters>(name);
 }
开发者ID:vigoo,项目名称:bari,代码行数:6,代码来源:ProjectParametersDependencies.cs


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