示例#1
0
        public static PerLanguageOption <CodeStyleOption <T> > ToPublicOption <T>(
            this PerLanguageOption2 <CodeStyleOption2 <T> > option
            )
        {
            RoslynDebug.Assert(option != null);

            var codeStyleOption  = new CodeStyleOption <T>(option.DefaultValue);
            var optionDefinition = new OptionDefinition(
                option.Feature,
                option.Group,
                option.Name,
                defaultValue: codeStyleOption,
                type: typeof(CodeStyleOption <T>),
                isPerLanguage: true
                );

            return(new PerLanguageOption <CodeStyleOption <T> >(
                       optionDefinition,
                       option.StorageLocations.As <OptionStorageLocation>()
                       ));
        }
 internal DocumentOptionSet WithChangedOption <T>(PerLanguageOption2 <T> option, T value)
 => (DocumentOptionSet)WithChangedOption(option, _language, value);
 internal T GetOption <T>(PerLanguageOption2 <T> option)
 => _backingOptionSet.GetOption(option, _language);
示例#4
0
 /// <summary>
 /// Gets the value of the option, or the default value if not otherwise set.
 /// </summary>
 internal T GetOption <T>(PerLanguageOption2 <T> option, string?language)
 => OptionsHelpers.GetOption(option, language, _getOptionCore);
示例#5
0
 /// <summary>
 /// Creates a new <see cref="OptionSet" /> that contains the changed value.
 /// </summary>
 internal OptionSet WithChangedOption <T>(PerLanguageOption2 <T> option, string?language, T value)
 => WithChangedOption(new OptionKey(option, language), value);
 public static T GetOption <T>(PerLanguageOption2 <T> option, string?language, Func <OptionKey, object?> getOption)
 => GetOption <T>(new OptionKey(option, language), getOption);
示例#7
0
 internal T GetOption <T>(PerLanguageOption2 <T> option)
 {
     return(_backingOptionSet.GetOption(option, _language));
 }
 [return : MaybeNull] public T GetOption <T>(PerLanguageOption2 <T> option, string?languageName) => _globalOptionService.GetOption(option, languageName);