本文整理汇总了C#中IArgumentProvider.GetOption方法的典型用法代码示例。如果您正苦于以下问题:C# IArgumentProvider.GetOption方法的具体用法?C# IArgumentProvider.GetOption怎么用?C# IArgumentProvider.GetOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IArgumentProvider
的用法示例。
在下文中一共展示了IArgumentProvider.GetOption方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
protected void Initialize(IArgumentProvider arguments)
{
string assembliesToResolve = arguments.GetOption<string>(StandardOptions.AssembliesToResolve);
if (!String.IsNullOrEmpty(assembliesToResolve))
{
foreach (string assemblyToResolve in assembliesToResolve.Split(';'))
{
this.AddAssemblyToResolve(assemblyToResolve);
}
}
string resolutionPaths = arguments.GetOption<string>(StandardOptions.AssemblyResolutionPaths);
if (!String.IsNullOrEmpty(resolutionPaths))
{
foreach (string resolutionPath in resolutionPaths.Split(';'))
{
if (!String.IsNullOrWhiteSpace(resolutionPath))
{
string expandedResolutionPath = Environment.ExpandEnvironmentVariables(resolutionPath);
this.AddResolutionPath(expandedResolutionPath);
}
}
}
}
示例2: ConsoleTaskLoggers
public ConsoleTaskLoggers(ITask task, IArgumentProvider arguments)
{
if (arguments.GetOption<bool?>(StandardOptions.Clipboard) ?? task.GetOptionDefault<bool>(StandardOptions.Clipboard[0]))
{
this.richTextLogger = new RichTextLogger();
this.csvLogger = new CsvLogger();
this.textLogger = new TextLogger();
this.spreadsheetLogger = new XmlSpreadsheetLogger();
this.aggregatedLogger = new AggregatedLogger(
ConsoleLogger.Instance,
this.richTextLogger,
this.spreadsheetLogger,
this.csvLogger,
this.textLogger);
this.RegisterLogger(LoggerType.Result, this.aggregatedLogger);
}
else
{
this.RegisterLogger(LoggerType.Result, ConsoleLogger.Instance);
}
this.RegisterLogger(LoggerType.Status, ConsoleLogger.Instance);
}