Esempio n. 1
0
 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;
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
            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);
            }