Esempio n. 1
0
    public ConfigurationValues(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree tree)
    {
        var options = optionsProvider.GetOptions(tree);

        this.IndentStyle = options.TryGetValue(ConfigurationValues.IndentStyleKey, out var indentStyle) ?
                           (Enum.TryParse <IndentStyle>(indentStyle, out var indentStyleValue) ? indentStyleValue : ConfigurationValues.IndentStyleDefaultValue) :
                           ConfigurationValues.IndentStyleDefaultValue;
        this.IndentSize = options.TryGetValue(ConfigurationValues.IndentSizeKey, out var indentSize) ?
                          (uint.TryParse(indentSize, out var indentSizeValue) ? indentSizeValue : ConfigurationValues.IndentSizeDefaultValue) :
                          ConfigurationValues.IndentSizeDefaultValue;
    }
Esempio n. 2
0
            static SyntaxTreeCategorizedAnalyzerConfigOptions Create(SyntaxTree tree, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider)
            {
                var options = analyzerConfigOptionsProvider.GetOptions(tree);

                return(SyntaxTreeCategorizedAnalyzerConfigOptions.Create(options));
            }