本文整理汇总了C#中Project.GetInheritableParameters方法的典型用法代码示例。如果您正苦于以下问题:C# Project.GetInheritableParameters方法的具体用法?C# Project.GetInheritableParameters怎么用?C# Project.GetInheritableParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project.GetInheritableParameters方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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.GetInheritableParameters<CsharpProjectParameters, CsharpProjectParametersDef>("csharp");
parameters.FillProjectSpecificMissingInfo(project);
parameters.ToCsprojProperties(writer);
WriteAppConfig(writer, project);
WriteManifest(writer, project);
WriteApplicationIcon(writer, project, parameters);
writer.WriteEndElement();
}
示例2: Write
public override void Write(XmlWriter writer, Project project, IMSBuildProjectGeneratorContext context)
{
var platform = platformManagement.GetDefaultPlatform(project);
var cliMode = GetCLIMode(project);
writer.WriteStartElement("ItemGroup");
writer.WriteAttributeString("Label", "ProjectConfigurations");
writer.WriteStartElement("ProjectConfiguration");
writer.WriteAttributeString("Include", string.Format("Bari|{0}", platform));
writer.WriteElementString("Configuration", "Bari");
writer.WriteElementString("Platform", platform);
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteStartElement("PropertyGroup");
writer.WriteAttributeString("Label", "Globals");
writer.WriteElementString("ProjectGuid", projectGuidManagement.GetGuid(project).ToString("B"));
if (cliMode == CppCliMode.Disabled)
{
writer.WriteElementString("Keyword", "Win32Proj");
}
else
{
VCppProjectCompilerParameters compilerParameters = project.GetInheritableParameters<VCppProjectCompilerParameters, VCppProjectCompilerParametersDef>("cpp-compiler");
compilerParameters.WriteGlobalProperties(writer);
writer.WriteElementString("Keyword", "ManagedCProj");
writer.WriteElementString("RootNamespace", project.Name);
}
writer.WriteEndElement();
writer.WriteStartElement("PropertyGroup");
writer.WriteAttributeString("Condition", string.Format("'$(Configuration)|$(Platform)' == 'Bari|{0}' ", platform));
writer.WriteAttributeString("Label", "Configuration");
WriteHighLevelConfigurationSpecificPart(writer, project);
writer.WriteEndElement();
writer.WriteStartElement("Import");
writer.WriteAttributeString("Project", @"$(VCTargetsPath)\Microsoft.Cpp.props");
writer.WriteEndElement();
writer.WriteStartElement("PropertyGroup");
writer.WriteAttributeString("Condition", string.Format("'$(Configuration)|$(Platform)' == 'Bari|{0}' ", platform));
WriteConfigurationSpecificPart(writer, project);
writer.WriteEndElement();
writer.WriteStartElement("ItemDefinitionGroup");
writer.WriteAttributeString("Condition", string.Format(" '$(Configuration)|$(Platform)' == 'Bari|{0}' ", platform));
WriteMIDLParameters(writer, project);
WriteCompilerParameters(writer, project);
WriteLinkerParameters(writer, project);
WriteManifestParameters(writer, project);
WriteResourceCompilerParameters(writer, project);
writer.WriteEndElement();
}
示例3: 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.GetInheritableParameters<FsharpProjectParameters, FsharpProjectParametersDef>("fsharp");
parameters.FillProjectSpecificMissingInfo(project);
parameters.ToFsprojProperties(writer);
writer.WriteEndElement();
}
示例4: IsWPFApplicationDefinition
private bool IsWPFApplicationDefinition(Project project, string file)
{
var relativePath = ToProjectRelativePath(project, file, ProjectSourceSetName);
if (project.HasParameters("wpf"))
{
var wpfParameters = project.GetInheritableParameters<WPFParameters, WPFParametersDef>("wpf");
return relativePath.Equals(wpfParameters.ApplicationDefinition, StringComparison.InvariantCultureIgnoreCase);
}
return false;
}
示例5: PrefixWithRootNamespace
private string PrefixWithRootNamespace(Project project, string path)
{
CsharpProjectParameters parameters = project.GetInheritableParameters<CsharpProjectParameters, CsharpProjectParametersDef>("csharp");
parameters.FillProjectSpecificMissingInfo(project);
return parameters.RootNamespace + "." + path;
}
示例6: GetCLIMode
private CppCliMode GetCLIMode(Project project)
{
VCppProjectCLIParameters cliParameters =
project.GetInheritableParameters<VCppProjectCLIParameters, VCppProjectCLIParametersDef>("cli");
return cliParameters.IsModeSpecified ? cliParameters.Mode : CppCliMode.Disabled;
}
示例7: WriteCompilerParameters
private void WriteCompilerParameters(XmlWriter writer, Project project)
{
VCppProjectCompilerParameters compilerParameters = project.GetInheritableParameters<VCppProjectCompilerParameters, VCppProjectCompilerParametersDef>("cpp-compiler");
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();
}
示例8: GetUseOfAtl
private string GetUseOfAtl(Project project)
{
VCppProjectATLParameters atlParameters =
project.GetInheritableParameters<VCppProjectATLParameters, VCppProjectATLParametersDef>("atl");
if (atlParameters.IsUseOfATLSpecified)
{
switch (atlParameters.UseOfATL)
{
case UseOfATL.None:
return String.Empty;
case UseOfATL.Static:
return "Static";
case UseOfATL.Dynamic:
return "Dynamic";
default:
throw new ArgumentOutOfRangeException();
}
}
else
{
return String.Empty;
}
}
示例9: GetToolchain
private VCppProjectToolchainParameters GetToolchain(Project project)
{
VCppProjectToolchainParameters toolChainParams =
project.GetInheritableParameters<VCppProjectToolchainParameters, VCppProjectToolchainParametersDef>("toolchain");
return toolChainParams;
}
示例10: GetManifestParameters
private VCppProjectManifestParameters GetManifestParameters(Project project)
{
VCppProjectManifestParameters manifestParameters = project.GetInheritableParameters<VCppProjectManifestParameters, VCppProjectManifestParametersDef>("manifest");
manifestParameters.FillProjectSpecificMissingInfo(project);
return manifestParameters;
}
示例11: GetLinkerParameters
private VCppProjectLinkerParameters GetLinkerParameters(Project project)
{
return project.GetInheritableParameters<VCppProjectLinkerParameters, VCppProjectLinkerParametersDef>("cpp-linker");
}