protected internal StyleCopSettings(JsonObject settingsObject)
            : this()
        {
            foreach (var kvp in settingsObject)
            {
                var childSettingsObject = kvp.Value.AsJsonObject;
                switch (kvp.Key)
                {
                case "indentation":
                    kvp.AssertIsObject();
                    this.indentation = new IndentationSettings(childSettingsObject);
                    break;

                case "spacingRules":
                    kvp.AssertIsObject();
                    this.spacingRules = new SpacingSettings(childSettingsObject);
                    break;

                case "readabilityRules":
                    kvp.AssertIsObject();
                    this.readabilityRules = new ReadabilitySettings(childSettingsObject);
                    break;

                case "orderingRules":
                    kvp.AssertIsObject();
                    this.orderingRules = new OrderingSettings(childSettingsObject);
                    break;

                case "namingRules":
                    kvp.AssertIsObject();
                    this.namingRules = new NamingSettings(childSettingsObject);
                    break;

                case "maintainabilityRules":
                    kvp.AssertIsObject();
                    this.maintainabilityRules = new MaintainabilitySettings(childSettingsObject);
                    break;

                case "layoutRules":
                    kvp.AssertIsObject();
                    this.layoutRules = new LayoutSettings(childSettingsObject);
                    break;

                case "documentationRules":
                    kvp.AssertIsObject();
                    this.documentationRules = new DocumentationSettings(childSettingsObject);
                    break;

                case "alignmentRules":
                    kvp.AssertIsObject();
                    this.alignmentRules = new AlignmentSettings(childSettingsObject);
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 2
0
 protected internal StyleCopSettings()
 {
     this.spacingRules         = new SpacingSettings();
     this.readabilityRules     = new ReadabilitySettings();
     this.orderingRules        = new OrderingSettings();
     this.namingRules          = new NamingSettings();
     this.maintainabilityRules = new MaintainabilitySettings();
     this.layoutRules          = new LayoutSettings();
     this.documentationRules   = new DocumentationSettings();
 }
 protected internal StyleCopSettings()
 {
     this.spacingRules = new SpacingSettings();
     this.readabilityRules = new ReadabilitySettings();
     this.orderingRules = new OrderingSettings();
     this.namingRules = new NamingSettings();
     this.maintainabilityRules = new MaintainabilitySettings();
     this.layoutRules = new LayoutSettings();
     this.documentationRules = new DocumentationSettings();
 }
        protected internal StyleCopSettings()
        {
            this.indentation = new IndentationSettings();

            this.spacingRules         = new SpacingSettings();
            this.readabilityRules     = new ReadabilitySettings();
            this.orderingRules        = new OrderingSettings();
            this.namingRules          = new NamingSettings();
            this.maintainabilityRules = new MaintainabilitySettings();
            this.layoutRules          = new LayoutSettings();
            this.documentationRules   = new DocumentationSettings();
            this.excludedFileFilters  = default(string[]);
            this.excludedFiles        = default(string[]);
        }
        protected internal StyleCopSettings(JsonObject settingsObject, AnalyzerConfigOptionsWrapper analyzerConfigOptions)
        {
            foreach (var kvp in settingsObject)
            {
                var childSettingsObject = kvp.Value.AsJsonObject;
                switch (kvp.Key)
                {
                case "indentation":
                    kvp.AssertIsObject();
                    this.indentation = new IndentationSettings(childSettingsObject, analyzerConfigOptions);
                    break;

                case "spacingRules":
                    kvp.AssertIsObject();
                    this.spacingRules = new SpacingSettings(childSettingsObject, analyzerConfigOptions);
                    break;

                case "readabilityRules":
                    kvp.AssertIsObject();
                    this.readabilityRules = new ReadabilitySettings(childSettingsObject, analyzerConfigOptions);
                    break;

                case "orderingRules":
                    kvp.AssertIsObject();
                    this.orderingRules = new OrderingSettings(childSettingsObject, analyzerConfigOptions);
                    break;

                case "namingRules":
                    kvp.AssertIsObject();
                    this.namingRules = new NamingSettings(childSettingsObject, analyzerConfigOptions);
                    break;

                case "maintainabilityRules":
                    kvp.AssertIsObject();
                    this.maintainabilityRules = new MaintainabilitySettings(childSettingsObject, analyzerConfigOptions);
                    break;

                case "layoutRules":
                    kvp.AssertIsObject();
                    this.layoutRules = new LayoutSettings(childSettingsObject, analyzerConfigOptions);
                    break;

                case "documentationRules":
                    kvp.AssertIsObject();
                    this.documentationRules = new DocumentationSettings(childSettingsObject, analyzerConfigOptions);
                    break;

                default:
                    break;
                }
            }

            this.indentation ??= new IndentationSettings(new JsonObject(), analyzerConfigOptions);

            this.spacingRules ??= new SpacingSettings(new JsonObject(), analyzerConfigOptions);
            this.readabilityRules ??= new ReadabilitySettings(new JsonObject(), analyzerConfigOptions);
            this.orderingRules ??= new OrderingSettings(new JsonObject(), analyzerConfigOptions);
            this.namingRules ??= new NamingSettings(new JsonObject(), analyzerConfigOptions);
            this.maintainabilityRules ??= new MaintainabilitySettings(new JsonObject(), analyzerConfigOptions);
            this.layoutRules ??= new LayoutSettings(new JsonObject(), analyzerConfigOptions);
            this.documentationRules ??= new DocumentationSettings(new JsonObject(), analyzerConfigOptions);
        }