本文整理汇总了C#中IOption类的典型用法代码示例。如果您正苦于以下问题:C# IOption类的具体用法?C# IOption怎么用?C# IOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOption类属于命名空间,在下文中一共展示了IOption类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:RoryVL,项目名称:roslyn,代码行数:33,代码来源:InternalOptionSerializer.cs
示例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);
}
}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:29,代码来源:DebugProject.cs
示例3: OnOptionChanged
public static ITaggerEventSource OnOptionChanged(
ITextBuffer subjectBuffer,
IOption option,
TaggerDelay delay)
{
return new OptionChangedEventSource(subjectBuffer, option, delay);
}
开发者ID:noahstein,项目名称:roslyn,代码行数:7,代码来源:TaggerEventSources.cs
示例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;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:7,代码来源:AreaOption.cs
示例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;
}
开发者ID:gmarklow87,项目名称:OptionLib,代码行数:33,代码来源:GreekFactory.cs
示例6: AddOption
private void AddOption(StackPanel panel, IOption option)
{
var uiElement = CreateControl(option);
if (uiElement != null)
{
panel.Children.Add(uiElement);
}
}
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:8,代码来源:InternalOptionsControl.cs
示例7: AddPerLanguageOption
private void AddPerLanguageOption(StackPanel panel, IOption option, string languageName)
{
var uiElement = CreateControl(option, languageName);
if (uiElement != null)
{
panel.Children.Add(uiElement);
}
}
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:8,代码来源:InternalOptionsControl.cs
示例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);
}
}
开发者ID:XieShuquan,项目名称:roslyn,代码行数:8,代码来源:InternalOptionsControl.cs
示例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) };
}
开发者ID:rho24,项目名称:Jarvis,代码行数:8,代码来源:OpenContainingDirectoryModule.cs
示例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;
}
开发者ID:deveel,项目名称:deveel-cli,代码行数:8,代码来源:AlreadySelectedException.cs
示例11: AbstractCheckBoxViewModel
public AbstractCheckBoxViewModel(IOption option, string description, string truePreview, string falsePreview, AbstractOptionPreviewViewModel info)
{
_truePreview = truePreview;
_falsePreview = falsePreview;
Info = info;
Option = option;
Description = description;
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:9,代码来源:AbstractCheckBoxViewModel.cs
示例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)));
}
开发者ID:GloryChou,项目名称:roslyn,代码行数:9,代码来源:CheckBoxViewModel.cs
示例13: GeneralOptionView
public GeneralOptionView(IOption option)
{
if(option == null)
throw new ArgumentNullException("option");
_option = option;
//初始化窗体组件
InitializeComponent();
}
开发者ID:Flagwind,项目名称:Zongsoft.CoreLibrary,代码行数:10,代码来源:GeneralOptionView.cs
示例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);
}
开发者ID:rho24,项目名称:Jarvis,代码行数:10,代码来源:ExposeModulesModule.cs
示例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;
}
开发者ID:0916174,项目名称:INFDEV,代码行数:10,代码来源:ActionButton.cs
示例16: MatchesSearch
internal static bool MatchesSearch(IOption opt, string searchText)
{
if (!string.IsNullOrEmpty(opt.DisplayName))
{
int dispIndex = opt.DisplayName.IndexOf(searchText, 0, StringComparison.InvariantCultureIgnoreCase);
if (dispIndex != -1)
return true;
}
int index = opt.Name.IndexOf(searchText, 0, StringComparison.InvariantCultureIgnoreCase);
return (index > -1);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:11,代码来源:IOption.cs
示例17: CheckBoxWithComboOptionViewModel
public CheckBoxWithComboOptionViewModel(IOption option, string description, string truePreview, string falsePreview, AbstractOptionPreviewViewModel info, OptionSet options, IList<NotificationOptionViewModel> items)
: base(option, description, truePreview, falsePreview, info)
{
NotificationOptions = items;
var codeStyleOption = ((CodeStyleOption<bool>)options.GetOption(new OptionKey(option, option.IsPerLanguage ? info.Language : null)));
SetProperty(ref _isChecked, codeStyleOption.Value);
var notificationViewModel = items.Where(i => i.Notification.Value == codeStyleOption.Notification.Value).Single();
SetProperty(ref _selectedNotificationOption, notificationViewModel);
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:11,代码来源:CheckBoxWithComboViewModel.cs
示例18: CreateOptionNode
private TreeNode CreateOptionNode(TreeNode containerNode, IOption option)
{
TreeNode node = new TreeNode(option.VariableName) { Tag = option };
containerNode.Nodes.Add(node);
UpdateTreeNodeText(option, "VariableName", node);
// On force une mise à jour pour mettre l'interface à jour
string a = option.VariableName;
option.VariableName = string.Empty;
option.VariableName = a;
return node;
}
开发者ID:Daimakaicho,项目名称:MenuDesigner,代码行数:12,代码来源:Form1.cs
示例19: SetChangedOption
private void SetChangedOption(IOptionService optionService, IOption option, string languageName)
{
OptionKey key = new OptionKey(option, languageName);
object currentValue;
if (this.TryFetch(key, out currentValue))
{
OptionSet optionSet = optionService.GetOptions();
optionSet = optionSet.WithChangedOption(key, currentValue);
optionService.SetOptions(optionSet);
}
}
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:13,代码来源:AbstractSettingsManagerOptionSerializer.cs
示例20: ExtractOptionArgs
private string[] ExtractOptionArgs(Queue<string> argQueue, IOption option)
{
string[] arguments;
if (option != null && option.ParameterCount > 0 && argQueue.Count > 0 && !argQueue.Peek().StartsWith("/"))
{
if (option.IsBoolean && !IsBoolValue(argQueue.Peek()))
arguments = new string[] {};
else
arguments = option.ParameterCount == 1 ? new[] { argQueue.Dequeue() } : argQueue.Dequeue().Split(',');
}
else
arguments = new string[] {};
return arguments;
}
开发者ID:jamie-davis,项目名称:ConsoleTools,代码行数:15,代码来源:MsDosCommandLineParser.cs
注:本文中的IOption类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论