public static StylerService CreateInstance(IStylerOptions options) { var stylerServiceInstance = new StylerService { Options = options }; stylerServiceInstance.NewlineExemptionElementsList = stylerServiceInstance.Options.NewlineExemptionElements.ToList(); stylerServiceInstance.NoNewLineMarkupExtensionsList = stylerServiceInstance.Options.NoNewLineMarkupExtensions.ToList(); stylerServiceInstance.OrderRules = new AttributeOrderRules(options); stylerServiceInstance.ElementProcessStatusStack.Clear(); stylerServiceInstance.ElementProcessStatusStack.Push(new ElementProcessStatus()); return stylerServiceInstance; }
public static StylerService CreateInstance(IStylerOptions options) { var stylerServiceInstance = new StylerService { Options = options }; stylerServiceInstance.NewlineExemptionElementsList = stylerServiceInstance.Options.NewlineExemptionElements.ToList(); stylerServiceInstance.FirstLineAttributes = stylerServiceInstance.Options.FirstLineAttributes.ToList(); stylerServiceInstance.NoNewLineMarkupExtensionsList = stylerServiceInstance.Options.NoNewLineMarkupExtensions.ToList(); stylerServiceInstance.OrderRules = new AttributeOrderRules(options); stylerServiceInstance.ElementProcessStatusStack.Clear(); stylerServiceInstance.ElementProcessStatusStack.Push(new ElementProcessStatus()); return(stylerServiceInstance); }
public XamlMagicConsole(Options options) { this.options = options; StylerOptions stylerOptions = new StylerOptions(); if (this.options.Configuration != null) { var config = File.ReadAllText(this.options.Configuration); stylerOptions = JsonConvert.DeserializeObject<StylerOptions>(config); if (this.options.LogLevel == LogLevel.Insanity) { this.Log(JsonConvert.SerializeObject(stylerOptions), LogLevel.Insanity); } this.Log(JsonConvert.SerializeObject(stylerOptions.AttributeOrderingRuleGroups), LogLevel.Debug); } this.stylerService = StylerService.CreateInstance(stylerOptions); }