예제 #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
파일: OptionSet.cs 프로젝트: lameox/roslyn
 /// <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
파일: OptionSet.cs 프로젝트: lameox/roslyn
 /// <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);
예제 #6
0
 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));
 }
예제 #8
0
 [return : MaybeNull] public T GetOption <T>(PerLanguageOption2 <T> option, string?languageName) => _globalOptionService.GetOption(option, languageName);