本文整理汇总了C#中IConfiguration.DisableComments方法的典型用法代码示例。如果您正苦于以下问题:C# IConfiguration.DisableComments方法的具体用法?C# IConfiguration.DisableComments怎么用?C# IConfiguration.DisableComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConfiguration
的用法示例。
在下文中一共展示了IConfiguration.DisableComments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public bool Parse(string[] args, IConfiguration configuration, TextWriter stdout)
{
var currentDirectory =
this.fileSystem.DirectoryInfo.FromDirectoryName(this.fileSystem.Directory.GetCurrentDirectory());
configuration.FeatureFolder = currentDirectory;
configuration.OutputFolder = currentDirectory;
this.options.Parse(args);
if (this.versionRequested)
{
this.DisplayVersion(stdout);
return false;
}
else if (this.helpRequested)
{
this.DisplayHelp(stdout);
return false;
}
if (!string.IsNullOrEmpty(this.featureDirectory))
{
configuration.FeatureFolder = this.fileSystem.DirectoryInfo.FromDirectoryName(this.featureDirectory);
}
if (!string.IsNullOrEmpty(this.outputDirectory))
{
configuration.OutputFolder = this.fileSystem.DirectoryInfo.FromDirectoryName(this.outputDirectory);
}
if (!string.IsNullOrEmpty(this.testResultsFormat))
{
configuration.TestResultsFormat =
(TestResultsFormat)Enum.Parse(typeof(TestResultsFormat), this.testResultsFormat, true);
}
if (!string.IsNullOrEmpty(this.testResultsFile))
{
var files = this.testResultsFile.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
configuration.AddTestResultFiles(files.Select(f => this.fileSystem.FileInfo.FromFileName(f)));
}
if (!string.IsNullOrEmpty(this.systemUnderTestName))
{
configuration.SystemUnderTestName = this.systemUnderTestName;
}
if (!string.IsNullOrEmpty(this.systemUnderTestVersion))
{
configuration.SystemUnderTestVersion = this.systemUnderTestVersion;
}
if (!string.IsNullOrEmpty(this.language))
{
configuration.Language = this.language;
}
if (!string.IsNullOrEmpty(this.documentationFormat))
{
configuration.DocumentationFormat =
(DocumentationFormat)Enum.Parse(typeof(DocumentationFormat), this.documentationFormat, true);
}
if (this.includeExperimentalFeatures)
{
configuration.EnableExperimentalFeatures();
}
bool enableComments;
if (bool.TryParse(this.enableCommentsValue, out enableComments) && enableComments == false)
{
configuration.DisableComments();
}
return true;
}
示例2: CaptureConfiguration
private void CaptureConfiguration(IConfiguration configuration, IFileSystem fileSystem)
{
configuration.FeatureFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.FeatureDirectory);
configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.OutputDirectory);
if (!string.IsNullOrEmpty(this.Language))
{
configuration.Language = this.Language;
}
if (!string.IsNullOrEmpty(this.ResultsFormat))
{
configuration.TestResultsFormat = (TestResultsFormat)Enum.Parse(typeof(TestResultsFormat), this.ResultsFormat, true);
}
if (!string.IsNullOrEmpty(this.ResultsFile))
{
configuration.AddTestResultFile(fileSystem.FileInfo.FromFileName(this.ResultsFile));
}
if (!string.IsNullOrEmpty(this.SystemUnderTestName))
{
configuration.SystemUnderTestName = this.SystemUnderTestName;
}
if (!string.IsNullOrEmpty(this.SystemUnderTestVersion))
{
configuration.SystemUnderTestVersion = this.SystemUnderTestVersion;
}
if (!string.IsNullOrEmpty(this.DocumentationFormat))
{
configuration.DocumentationFormat = (DocumentationFormat)Enum.Parse(typeof(DocumentationFormat), this.DocumentationFormat, true);
}
bool shouldEnableExperimentalFeatures;
if (bool.TryParse(this.IncludeExperimentalFeatures, out shouldEnableExperimentalFeatures))
{
if (shouldEnableExperimentalFeatures)
{
configuration.EnableExperimentalFeatures();
}
}
bool shouldEnableComments;
if (bool.TryParse(this.EnableComments, out shouldEnableComments))
{
if (!shouldEnableComments)
{
configuration.DisableComments();
}
}
}
示例3: ParseParameters
private void ParseParameters(IConfiguration configuration, IFileSystem fileSystem, PathInfo currentFileSystemLocation)
{
configuration.FeatureFolder = this.DetermineFeatureFolder(fileSystem, currentFileSystemLocation, this.FeatureDirectory);
configuration.OutputFolder = this.DetermineFeatureFolder(fileSystem, currentFileSystemLocation, this.OutputDirectory);
if (!string.IsNullOrEmpty(this.TestResultsFormat))
{
configuration.TestResultsFormat =
(TestResultsFormat)Enum.Parse(typeof(TestResultsFormat), this.TestResultsFormat, true);
}
if (!string.IsNullOrEmpty(this.TestResultsFile))
{
configuration.AddTestResultFile(fileSystem.FileInfo.FromFileName(this.TestResultsFile));
}
configuration.SystemUnderTestName = this.SystemUnderTestName;
configuration.SystemUnderTestVersion = this.SystemUnderTestVersion;
if (!string.IsNullOrEmpty(this.DocumentationFormat))
{
configuration.DocumentationFormat = (DocumentationFormat)Enum.Parse(typeof(DocumentationFormat), this.DocumentationFormat, true);
}
if (!string.IsNullOrEmpty(this.Language))
{
configuration.Language = this.Language;
}
if (this.IncludeExperimentalFeatures.IsPresent)
{
configuration.EnableExperimentalFeatures();
}
if (this.IncludeExperimentalFeatures.IsPresent)
{
configuration.EnableExperimentalFeatures();
}
bool shouldEnableComments;
if (bool.TryParse(this.EnableComments, out shouldEnableComments))
{
if (!shouldEnableComments)
{
configuration.DisableComments();
}
}
}