本文整理汇总了C#中IOption类的典型用法代码示例。如果您正苦于以下问题:C# IOption类的具体用法?C# IOption怎么用?C# IOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOption类属于命名空间,在下文中一共展示了IOption类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCollectionPathAndPropertyNameForOption
protected override Tuple<string, string> GetCollectionPathAndPropertyNameForOption(IOption key, string languageName)
{
if (key.Feature == EditorComponentOnOffOptions.OptionName)
{
return Tuple.Create(@"Roslyn\Internal\OnOff\Components", key.Name);
}
else if (key.Feature == InternalFeatureOnOffOptions.OptionName)
{
return Tuple.Create(@"Roslyn\Internal\OnOff\Features", key.Name);
}
else if (key.Feature == PerformanceFunctionIdOptionsProvider.Name)
{
return Tuple.Create(@"Roslyn\Internal\Performance\FunctionId", key.Name);
}
else if (key.Feature == LoggerOptions.FeatureName)
{
return Tuple.Create(@"Roslyn\Internal\Performance\Logger", key.Name);
}
else if (key.Feature == InternalDiagnosticsOptions.OptionName)
{
return Tuple.Create(@"Roslyn\Internal\Diagnostics", key.Name);
}
else if (key.Feature == InternalSolutionCrawlerOptions.OptionName)
{
return Tuple.Create(@"Roslyn\Internal\SolutionCrawler", key.Name);
}
else if (key.Feature == CacheOptions.FeatureName)
{
return Tuple.Create(@"Roslyn\Internal\Performance\Cache", key.Name);
}
throw ExceptionUtilities.Unreachable;
}
示例2: DisplayOptionToUser
public override bool DisplayOptionToUser(IOption option, Interfaces.IScriptBaseObject iteratorObject)
{
try
{
if (option.DisplayToUserValue.HasValue)
{
return option.DisplayToUserValue.Value;
}
if (string.IsNullOrEmpty(option.DisplayToUserFunction))
{
return true;
}
if (iteratorObject == null)
{
object[] parameters = new object[0];
return (bool)Loader.Instance.CallTemplateFunction(option.DisplayToUserFunction, ref parameters);
}
else
{
object[] parameters = new object[] { iteratorObject };
return (bool)Loader.Instance.CallTemplateFunction(option.DisplayToUserFunction, ref parameters);
}
}
catch (MissingMethodException)
{
object[] parameters = new object[] { iteratorObject };
return (bool)Loader.Instance.CallTemplateFunction(option.DisplayToUserFunction, ref parameters);
}
}
示例3: OnOptionChanged
public static ITaggerEventSource OnOptionChanged(
ITextBuffer subjectBuffer,
IOption option,
TaggerDelay delay)
{
return new OptionChangedEventSource(subjectBuffer, option, delay);
}
示例4: AddSubOption
public void AddSubOption(IOption option, PolicyOptionScopeEnum policyScope)
{
option.PropertyChanged += OnPropertyChanged;
if (SubOptions[(int)policyScope] != null)
throw new InvalidOperationException("Duplicate policy scope specified for same area option");
SubOptions[(int)policyScope] = option;
}
示例5: Create
/// <summary>
/// Returns the Greek object for a given Greek name
/// </summary>
/// <param name="greek">Greek name</param>
/// <param name="option">Option object</param>
/// <returns></returns>
public static IGreek Create(GreekName greek, IOption option)
{
IGreek calculatedGreek = null;
switch (greek)
{
case GreekName.Delta:
calculatedGreek = new Delta(option);
break;
case GreekName.Gamma:
calculatedGreek = new Gamma(option);
break;
case GreekName.Theta:
calculatedGreek = new Theta(option);
break;
case GreekName.Vega:
calculatedGreek = new Vega(option);
break;
case GreekName.Rho:
calculatedGreek = new Rho(option);
break;
default:
break;
}
return calculatedGreek;
}
示例6: AddOption
private void AddOption(StackPanel panel, IOption option)
{
var uiElement = CreateControl(option);
if (uiElement != null)
{
panel.Children.Add(uiElement);
}
}
示例7: AddPerLanguageOption
private void AddPerLanguageOption(StackPanel panel, IOption option, string languageName)
{
var uiElement = CreateControl(option, languageName);
if (uiElement != null)
{
panel.Children.Add(uiElement);
}
}
示例8: AddOption
protected void AddOption(Panel panel, IOption option, string additional = null)
{
var uiElement = CreateControl(option, additional: additional);
if (uiElement != null)
{
panel.Children.Add(uiElement);
}
}
示例9: GetSubOptions
public IEnumerable<IOption> GetSubOptions(IOption selectedOption, string term)
{
var fileOption = selectedOption as FileOption;
if(fileOption == null)
return Enumerable.Empty<IOption>();
return new IOption[] { new OpenContainingDirectoryOption(fileOption) };
}
示例10: AlreadySelectedException
public AlreadySelectedException(IOptionGroup group, IOption option, IOption selected)
: this("The option '" + option.Key() + "' was specified but an option from this group "
+ "has already been selected: '" + selected.Key() + "'")
{
OptionGroup = group;
Option = option;
SelectedOption = selected;
}
示例11: AbstractCheckBoxViewModel
public AbstractCheckBoxViewModel(IOption option, string description, string truePreview, string falsePreview, AbstractOptionPreviewViewModel info)
{
_truePreview = truePreview;
_falsePreview = falsePreview;
Info = info;
Option = option;
Description = description;
}
示例12: CheckBoxOptionViewModel
public CheckBoxOptionViewModel(IOption option, string description, string truePreview, string falsePreview, AbstractOptionPreviewViewModel info, OptionSet options)
{
this.Option = option;
Description = description;
_truePreview = truePreview;
_falsePreview = falsePreview;
_info = info;
SetProperty(ref _isChecked, (bool)options.GetOption(new OptionKey(option, option.IsPerLanguage ? info.Language : null)));
}
示例13: GeneralOptionView
public GeneralOptionView(IOption option)
{
if(option == null)
throw new ArgumentNullException("option");
_option = option;
//初始化窗体组件
InitializeComponent();
}
示例14: GetSubOptions
public IEnumerable<IOption> GetSubOptions(IOption selectedOption, string term)
{
var option = selectedOption as ModuleOption;
if(option == null) return Enumerable.Empty<IOption>();
if(option.Module == this)
return _modules.Value.Select(m => new ModuleOption(m)).FuzzySearch(term).Fetch();
return option.Module.GetOptions(term);
}
示例15: ActionButton
public ActionButton(string _txt, string _assetName, Rectangle _rect, Game1.Actions _actionType, Game1 _game1, IOption<Animal> _animal)
{
this.txt = _txt;
this.assetName = _assetName;
this.rect = _rect;
this.actionType = _actionType;
this.animal = _animal;
_game1.buttonList.Add(this);
this.game1 = _game1;
}