本文整理汇总了C#中Project.HasParameters方法的典型用法代码示例。如果您正苦于以下问题:C# Project.HasParameters方法的具体用法?C# Project.HasParameters怎么用?C# Project.HasParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project.HasParameters方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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();
}
示例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();
}
示例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;
}
示例5: FillProjectSpecificMissingInfo
public void FillProjectSpecificMissingInfo(Project project)
{
if (project.HasParameters("midl"))
{
var midlParams = project.GetParameters<VCppProjectMIDLParameters>("midl");
TypeLibraryFile = midlParams.TypeLibraryName;
}
ComponentFileName = "$(TargetFileName)";
}
示例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();
}
}
示例7: Add
public static void Add(Project project, ICollection<IDependencies> target)
{
if (project.HasParameters("order"))
target.Add(new FileOrderDependencies(project));
}
示例8: 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;
}
示例9: GetManifestParameters
private VCppProjectManifestParameters GetManifestParameters(Project project)
{
VCppProjectManifestParameters manifestParameters = project.HasParameters("manifest")
? project.GetParameters<VCppProjectManifestParameters>("manifest")
: new VCppProjectManifestParameters(Suite);
manifestParameters.FillProjectSpecificMissingInfo(project);
return manifestParameters;
}
示例10: 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();
}
示例11: 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();
}
示例12: 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();
}
示例13: GetCLIMode
private CppCliMode GetCLIMode(Project project)
{
VCppProjectCLIParameters cliParameters = project.HasParameters("cli")
? project.GetParameters<VCppProjectCLIParameters>("cli")
: new VCppProjectCLIParameters();
return cliParameters.Mode;
}
示例14: 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();
}
}