public StylerService(IStylerOptions options) { this.xmlEscapingService = new XmlEscapingService(); this.documentManipulationService = new DocumentManipulationService(options); var indentService = new IndentService(options); var markupExtensionFormatter = new MarkupExtensionFormatter(options.NoNewLineMarkupExtensions.ToList()); var attributeInfoFactory = new AttributeInfoFactory(new MarkupExtensionParser(), new AttributeOrderRules(options)); var attributeInfoFormatter = new AttributeInfoFormatter(markupExtensionFormatter, indentService); this.documentProcessors = new Dictionary <XmlNodeType, IDocumentProcessor> { // { XmlNodeType.None, null }, { XmlNodeType.Element, new ElementDocumentProcessor(options, attributeInfoFactory, attributeInfoFormatter, indentService) }, // { XmlNodeType.Attribute, null }, { XmlNodeType.Text, new TextDocumentProcessor(indentService) }, { XmlNodeType.CDATA, new CDATADocumentProcessor(indentService) }, // { XmlNodeType.EntityReference, null }, // { XmlNodeType.Entity, null }, { XmlNodeType.ProcessingInstruction, new ProcessInstructionDocumentProcessor(indentService) }, { XmlNodeType.Comment, new CommentDocumentProcessor(options, indentService) }, // { XmlNodeType.Document, null }, // { XmlNodeType.DocumentType, null }, // { XmlNodeType.DocumentFragment, null }, // { XmlNodeType.Notation, null }, { XmlNodeType.Whitespace, new WhitespaceDocumentProcessor() }, { XmlNodeType.SignificantWhitespace, new SignificantWhitespaceDocumentProcessor() }, { XmlNodeType.EndElement, new EndElementDocumentProcessor(options, indentService) }, // { XmlNodeType.EndEntity, null }, // ignoring xml declarations for Xamarin support { XmlNodeType.XmlDeclaration, new XmlDeclarationDocumentProcessor() } }; }
public AttributeOrderRules(IStylerOptions options) { this.rules = new List <AttributeOrderRule>(); var groupIndex = 1; foreach (var @group in options.AttributeOrderingRuleGroups) { if (!string.IsNullOrWhiteSpace(@group)) { int priority = 1; string[] names = @group.Split(',') .Where(_ => !String.IsNullOrWhiteSpace(_)) .Select(_ => _.Trim()) .ToArray(); foreach (var name in names) { this.rules.Add(new AttributeOrderRule(name, groupIndex, priority)); priority++; } } groupIndex++; } // Add catch all group at the end ensuring we always get a match; this.rules.Add(new AttributeOrderRule("*", groupIndex, 0)); }
public StylerService(IStylerOptions options) { _xmlEscapingService = new XmlEscapingService(); _documentManipulationService = new DocumentManipulationService(options); var indentService = new IndentService(options.IndentWithTabs, options.IndentSize); var markupExtensionFormatter = new MarkupExtensionFormatter(options.NoNewLineMarkupExtensions.ToList()); var attributeInfoFactory = new AttributeInfoFactory(new MarkupExtensionParser(), new AttributeOrderRules(options)); var attributeInfoFormatter = new AttributeInfoFormatter(markupExtensionFormatter,indentService); _documentProcessors = new Dictionary<XmlNodeType, IDocumentProcessor> { //{XmlNodeType.None, null}, {XmlNodeType.Element, new ElementDocumentProcessor(options, attributeInfoFactory, attributeInfoFormatter, indentService)}, //{XmlNodeType.Attribute, null}, {XmlNodeType.Text, new TextDocumentProcessor(indentService)}, {XmlNodeType.CDATA, new CDATADocumentProcessor(indentService)}, //{XmlNodeType.EntityReference, null}, //{XmlNodeType.Entity, null}, {XmlNodeType.ProcessingInstruction, new ProcessInstructionDocumentProcessor(indentService)}, {XmlNodeType.Comment, new CommentDocumentProcessor(options, indentService)}, //{XmlNodeType.Document, null}, //{XmlNodeType.DocumentType, null}, //{XmlNodeType.DocumentFragment, null}, //{XmlNodeType.Notation, null}, {XmlNodeType.Whitespace, new WhitespaceDocumentProcessor()}, {XmlNodeType.SignificantWhitespace, new SignificantWhitespaceDocumentProcessor()}, {XmlNodeType.EndElement, new EndElementDocumentProcessor(options,indentService)}, //{XmlNodeType.EndEntity, null}, //ignoring xml declarations for Xamarin support {XmlNodeType.XmlDeclaration, new XmlDeclarationDocumentProcessor()} }; }
public StylerService(IStylerOptions options, XamlLanguageOptions xamlLanguageOptions) { this.xmlEscapingService = new XmlEscapingService(); this.documentManipulationService = new DocumentManipulationService(options); this.options = options; this.xamlLanguageOptions = xamlLanguageOptions; }
public AttributeOrderRules(IStylerOptions options) { this.Rules = new List<AttributeOrderRule>(); var groupIndex = 1; foreach (var @group in options.AttributeOrderingRuleGroups) { if (!String.IsNullOrWhiteSpace(@group)) { int priority = 1; string[] names = @group.Split(',') .Where(_ => !String.IsNullOrWhiteSpace(_)) .Select(_ => _.Trim()) .ToArray(); foreach (var name in names) { this.Rules.Add(new AttributeOrderRule(name, groupIndex, priority)); priority++; } } groupIndex++; } // Add catch all group at the end ensuring we always get a match; this.Rules.Add(new AttributeOrderRule("*", groupIndex, 0)); }
public IStylerOptions GetDocumentStylerOptions(Document document) { ThreadHelper.ThrowIfNotOnUIThread(); Properties xamlEditorProps = this.package.IDE.Properties["TextEditor", "XAML"]; IStylerOptions stylerOptions = this.GetGlobalStylerOptions(); string solutionPath = String.IsNullOrEmpty(this.package.IDE.Solution?.FullName) ? String.Empty : (stylerOptions.SearchToDriveRoot ? Path.GetPathRoot(this.package.IDE.Solution.FullName) : Path.GetDirectoryName(this.package.IDE.Solution.FullName)); Project project = document.ProjectItem?.ContainingProject; string configPath = GetConfigPathForItem(document.Path, solutionPath, project); if (configPath != null) { stylerOptions = ((StylerOptions)stylerOptions).Clone(); stylerOptions.ConfigPath = configPath; } if (stylerOptions.UseVisualStudioIndentSize) { if (Int32.TryParse(xamlEditorProps.Item("IndentSize").Value.ToString(), out int outIndentSize) && (outIndentSize > 0)) { stylerOptions.IndentSize = outIndentSize; } } if (stylerOptions.UseVisualStudioIndentWithTabs) { stylerOptions.IndentWithTabs = (bool)xamlEditorProps.Item("InsertTabs").Value; } return(stylerOptions); }
private static Func <Action> SetupExecuteContinuation(Document document, IStylerOptions stylerOptions) { ThreadHelper.ThrowIfNotOnUIThread(); var textDocument = (TextDocument)document.Object("TextDocument"); EditPoint startPoint = textDocument.StartPoint.CreateEditPoint(); EditPoint endPoint = textDocument.EndPoint.CreateEditPoint(); string xamlSource = startPoint.GetText(endPoint); return(() => { // this part can be executed in parallel. StylerService styler = new StylerService(stylerOptions); xamlSource = styler.StyleDocument(xamlSource); return () => { // this part should be executed sequentially. ThreadHelper.ThrowIfNotOnUIThread(); const int vsEPReplaceTextKeepMarkers = 1; startPoint.ReplaceText(endPoint, xamlSource, vsEPReplaceTextKeepMarkers); }; }); }
private IStylerOptions ParseOptionsOrDefault(string optionsFilePath, IStylerOptions defaultOptions, JsonConverter deserializeConverter = null) { try { optionsFilePath = PathUtils.ToAbsolutePath(optionsFilePath); if (string.IsNullOrEmpty(optionsFilePath) || !File.Exists(optionsFilePath)) { return(defaultOptions); } var optionsString = File.ReadAllText(optionsFilePath); var converters = deserializeConverter is null ? new JsonConverter[0] : new[] { deserializeConverter }; var options = JsonConvert.DeserializeObject <StylerOptions>(optionsString, converters); if (options.IndentSize == -1) { // TODO Check info about IndentSize, is it necessary options.IndentSize = 4; } // TODO Remove it when we will handle Indent from Visual Studio preferences options.IndentWithTabs |= defaultOptions.IndentWithTabs; return(options); } catch (Exception ex) { LoggingService.LogError("Failed to get Global XamlStyler options", ex); File.Delete(GlobalOptionsFilePath); return(defaultOptions); } }
private static void Execute(Document document, IStylerOptions stylerOptions) { ThreadHelper.ThrowIfNotOnUIThread(); if (IsFormatableDocument(document)) { SetupExecuteContinuation(document, stylerOptions)()(); } }
public ElementDocumentProcessor(IStylerOptions options, AttributeInfoFactory attributeInfoFactory, AttributeInfoFormatter attributeInfoFormatter, IndentService indentService) { _options = options; _attributeInfoFactory = attributeInfoFactory; _attributeInfoFormatter = attributeInfoFormatter; _indentService = indentService; _noNewLineElementsList = options.NoNewLineElements.ToList(); }
public ElementDocumentProcessor(IStylerOptions options, AttributeInfoFactory attributeInfoFactory, AttributeInfoFormatter attributeInfoFormatter, IndentService indentService) { _options = options; _attributeInfoFactory = attributeInfoFactory; _attributeInfoFormatter = attributeInfoFormatter; _indentService = indentService; _noNewLineElementsList = options.NoNewLineElements.ToList(); }
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 DocumentManipulationService(IStylerOptions options) { _options = options; _processElementServices = new List<IProcessElementService> { new FormatThicknessService(_options.ThicknessStyle, _options.ThicknessAttributes), GetReorderGridChildrenService(), GetReorderCanvasChildrenService(), GetReorderSettersService() }; }
public DocumentManipulationService(IStylerOptions options) { _options = options; _processElementServices = new List <IProcessElementService> { new FormatThicknessService(_options.ThicknessStyle, _options.ThicknessAttributes), GetReorderGridChildrenService(), GetReorderCanvasChildrenService(), GetReorderSettersService() }; }
public void SaveGlobalOptions(IStylerOptions options) { try { var fileData = JsonConvert.SerializeObject(options, new GlobalOptionsJsonConverter()); File.WriteAllText(GlobalOptionsFilePath, fileData); } catch (Exception ex) { LoggingService.LogError("Failed to save Global XamlStyler options", ex); } }
public DocumentManipulationService(IStylerOptions options) { this.options = options; this.processElementServices = new List<IProcessElementService> { new VSMReorderService() { Mode = this.options.ReorderVSM }, new FormatThicknessService(this.options.ThicknessStyle, this.options.ThicknessAttributes), this.GetReorderGridChildrenService(), this.GetReorderCanvasChildrenService(), this.GetReorderSettersService() }; }
public DocumentManipulationService(IStylerOptions options) { this.options = options; this.processElementServices = new List<IProcessElementService> { new VSMReorderService() { Mode = this.options.ReorderVSM }, new FormatThicknessService(this.options.ThicknessStyle, this.options.ThicknessAttributes), this.GetReorderGridChildrenService(), this.GetReorderCanvasChildrenService(), this.GetReorderSettersService() }; }
public ElementDocumentProcessor( IStylerOptions options, AttributeInfoFactory attributeInfoFactory, AttributeInfoFormatter attributeInfoFormatter, IndentService indentService) { this.options = options; this.attributeInfoFactory = attributeInfoFactory; this.attributeInfoFormatter = attributeInfoFormatter; this.indentService = indentService; this.noNewLineElementsList = options.NoNewLineElements.ToList(); this.firstLineAttributes = options.FirstLineAttributes.ToList(); }
public bool TryFormatXaml(ref string xamlText, IStylerOptions stylerOptions) { var stylerService = new StylerService(stylerOptions); var styledText = stylerService.StyleDocument(xamlText); if (xamlText == styledText) { return(false); } xamlText = styledText; return(true); }
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 AttributeOrderRules(IStylerOptions options) { _internalDictionary = new Dictionary<string, AttributeOrderRule>(); Populate(options.AttributeOrderWpfNamespace, AttributeTokenTypeEnum.WPF_NAMESPACE) .Populate(options.AttributeOrderClass, AttributeTokenTypeEnum.CLASS) .Populate(options.AttributeOrderKey, AttributeTokenTypeEnum.KEY) .Populate(options.AttributeOrderName, AttributeTokenTypeEnum.NAME) .Populate(options.AttributeOrderAttachedLayout, AttributeTokenTypeEnum.ATTACHED_LAYOUT) .Populate(options.AttributeOrderCoreLayout, AttributeTokenTypeEnum.CORE_LAYOUT) .Populate(options.AttributeOrderAlignmentLayout, AttributeTokenTypeEnum.ALIGNMENT_LAYOUT) .Populate(options.AttributeOrderOthers, AttributeTokenTypeEnum.OTHER) .Populate(options.AttributeOrderBlendRelated, AttributeTokenTypeEnum.BLEND_RELATED); }
public AttributeOrderRules(IStylerOptions options) { _internalDictionary = new Dictionary <string, AttributeOrderRule>(); Populate(options.AttributeOrderWpfNamespace, AttributeTokenTypeEnum.WPF_NAMESPACE) .Populate(options.AttributeOrderClass, AttributeTokenTypeEnum.CLASS) .Populate(options.AttributeOrderKey, AttributeTokenTypeEnum.KEY) .Populate(options.AttributeOrderName, AttributeTokenTypeEnum.NAME) .Populate(options.AttributeOrderAttachedLayout, AttributeTokenTypeEnum.ATTACHED_LAYOUT) .Populate(options.AttributeOrderCoreLayout, AttributeTokenTypeEnum.CORE_LAYOUT) .Populate(options.AttributeOrderAlignmentLayout, AttributeTokenTypeEnum.ALIGNMENT_LAYOUT) .Populate(options.AttributeOrderOthers, AttributeTokenTypeEnum.OTHER) .Populate(options.AttributeOrderBlendRelated, AttributeTokenTypeEnum.BLEND_RELATED); }
public AttributeOrderRules(IStylerOptions options) { internalDictionary = new Dictionary<string, AttributeOrderRule>(); this.Populate(options.AttributeOrderWpfNamespace, AttributeTokenInfoEnum.WpfNamespace) .Populate(options.AttributeOrderClass, AttributeTokenInfoEnum.Class) .Populate(options.AttributeOrderKey, AttributeTokenInfoEnum.Key) .Populate(options.AttributeOrderName, AttributeTokenInfoEnum.Name) .Populate(options.AttributeOrderAttachedLayout, AttributeTokenInfoEnum.AttachedLayout) .Populate(options.AttributeOrderCoreLayout, AttributeTokenInfoEnum.CoreLayout) .Populate(options.AttributeOrderAlignmentLayout, AttributeTokenInfoEnum.AlignmentLayout) .Populate(options.AttributeOrderOthers, AttributeTokenInfoEnum.Other) .Populate(options.AttributeOrderBlendRelated, AttributeTokenInfoEnum.BlendRelated); }
private void FormatDocument(Document document, IStylerOptions stylerOptions = null) { ThreadHelper.ThrowIfNotOnUIThread(); try { if (document.IsFormatable()) { SetupFormatDocumentContinuation(document, stylerOptions ?? this.optionsHelper.GetDocumentStylerOptions(document))()(); } } catch (Exception ex) { this.ShowMessageBox(ex); } }
private void FormatDocument(Document document, IStylerOptions stylerOptions = null) { ThreadHelper.ThrowIfNotOnUIThread(); try { var xamlLanguageOptions = document.GetXamlLanguageOptions(); if (xamlLanguageOptions.IsFormatable) { SetupFormatDocumentContinuation(document, stylerOptions ?? this.optionsHelper.GetDocumentStylerOptions(document), xamlLanguageOptions)()(); } } catch (Exception ex) { this.ShowMessageBox(ex); } }
public bool TryFormatXamlDocument(Document document, IStylerOptions stylerOptions) { var textBuffer = document.TextBuffer; var currentTextSnapshot = textBuffer.CurrentSnapshot; var xamlText = currentTextSnapshot.GetText(); if (!TryFormatXaml(ref xamlText, stylerOptions)) { return(false); } var replaceSpan = new Span(0, currentTextSnapshot.Length); textBuffer.Replace(replaceSpan, xamlText); document.IsDirty = true; return(true); }
public static StylerService CreateInstance(IStylerOptions options) { var stylerServiceInstance = new StylerService { Options = options }; if (!String.IsNullOrEmpty(stylerServiceInstance.Options.NoNewLineElements)) { stylerServiceInstance.NoNewLineElementsList = stylerServiceInstance.Options.NoNewLineElements.Split(',') .Where(x => !String.IsNullOrWhiteSpace(x)) .Select(x => x.Trim()) .ToList(); } stylerServiceInstance.OrderRules = new AttributeOrderRules(options); stylerServiceInstance._elementProcessStatusStack.Clear(); stylerServiceInstance._elementProcessStatusStack.Push(new ElementProcessStatus()); return stylerServiceInstance; }
private void OnFileSave(string guid, int id, object customIn, object customOut, ref bool cancelDefault) { ThreadHelper.ThrowIfNotOnUIThread(); IStylerOptions globalOptions = this.optionsHelper.GetGlobalStylerOptions(); if (!globalOptions.FormatOnSave) { return; } Document document = this.IDE2.ActiveDocument; IStylerOptions options = this.optionsHelper.GetDocumentStylerOptions(document); if (options.FormatOnSave) { this.FormatDocument(document, options); } }
private void FormatDocument(ProjectItem projectItem) { ThreadHelper.ThrowIfNotOnUIThread(); try { if (projectItem.IsFormatable()) { // Open document if not already open. bool wasOpen = projectItem.IsOpen[EnvDTE.Constants.vsViewKindTextView] || projectItem.IsOpen[EnvDTE.Constants.vsViewKindCode]; if (!wasOpen) { try { projectItem.Open(EnvDTE.Constants.vsViewKindTextView); } catch (Exception) { // Skip if file cannot be opened. } } Document document = projectItem.Document; if (document != null) { document.Activate(); this.FormatDocument(document); IStylerOptions globalOptions = this.optionsHelper.GetGlobalStylerOptions(); IStylerOptions options = this.optionsHelper.GetDocumentStylerOptions(document); if (!wasOpen && globalOptions.SaveAndCloseOnFormat && options.SaveAndCloseOnFormat) { document.Close(vsSaveChanges.vsSaveChangesYes); } } } } catch (Exception ex) { this.ShowMessageBox(ex); } }
public static StylerService CreateInstance(IStylerOptions options) { var stylerServiceInstance = new StylerService { Options = options }; if (!String.IsNullOrEmpty(stylerServiceInstance.Options.NoNewLineElements)) { stylerServiceInstance.NoNewLineElementsList = stylerServiceInstance.Options.NoNewLineElements.Split(',') .Where(x => !String.IsNullOrWhiteSpace(x)) .Select(x => x.Trim()) .ToList(); } stylerServiceInstance.OrderRules = new AttributeOrderRules(options); stylerServiceInstance._elementProcessStatusStack.Clear(); stylerServiceInstance._elementProcessStatusStack.Push(new ElementProcessStatus()); return(stylerServiceInstance); }
private void OnFileSaveAll(string guid, int id, object customIn, object customOut, ref bool cancelDefault) { ThreadHelper.ThrowIfNotOnUIThread(); IStylerOptions globalOptions = this.optionsHelper.GetGlobalStylerOptions(); if (!globalOptions.FormatOnSave) { return; } // Use parallel processing, but only on the documents that are formatable (to avoid the overhead of Task creating when it's not necessary). var jobs = new List <Func <Action> >(); foreach (Document document in this.IDE2.Documents) { // Skip unopened documents. if (document.ActiveWindow != null) { continue; } var xamlLanguageOptions = document.GetXamlLanguageOptions(); if (xamlLanguageOptions.IsFormatable) { IStylerOptions options = this.optionsHelper.GetDocumentStylerOptions(document); if (options.FormatOnSave) { jobs.Add(SetupFormatDocumentContinuation(document, options, xamlLanguageOptions)); } } } // Executes job() in parallel, then execute finish() sequentially. foreach (Action finish in jobs.AsParallel().Select(job => job())) { finish(); } }
public EndElementDocumentProcessor(IStylerOptions options,IndentService indentService) { _indentService = indentService; _options = options; }
public EndElementDocumentProcessor(IStylerOptions options, IndentService indentService) { _indentService = indentService; _options = options; }
public PackageOptions() { this.options = new StylerOptions(); }
public CommentDocumentProcessor(IStylerOptions options, IndentService indentService) { this.options = options; this.indentService = indentService; }
public IndentService(IStylerOptions options) { this.indentWithTabs = options.IndentWithTabs; this.indentSize = options.IndentSize; this.attributeIndentationStyle = options.AttributeIndentationStyle; }
public PackageOptions() { _options = new StylerOptions(); }
private void ApplyOptionOverrides(CommandLineOptions options, IStylerOptions stylerOptions) { if (options.IndentSize != null) { stylerOptions.IndentSize = options.IndentSize.Value; } if (options.IndentWithTabs != null) { stylerOptions.IndentWithTabs = options.IndentWithTabs.Value; } if (options.AttributesTolerance != null) { stylerOptions.AttributesTolerance = options.AttributesTolerance.Value; } if (options.KeepFirstAttributeOnSameLine != null) { stylerOptions.KeepFirstAttributeOnSameLine = options.KeepFirstAttributeOnSameLine.Value; } if (options.MaxAttributeCharactersPerLine != null) { stylerOptions.MaxAttributeCharactersPerLine = options.MaxAttributeCharactersPerLine.Value; } if (options.MaxAttributesPerLine != null) { stylerOptions.MaxAttributesPerLine = options.MaxAttributesPerLine.Value; } if (options.NoNewLineElements != null) { stylerOptions.NoNewLineElements = options.NoNewLineElements; } if (options.PutAttributeOrderRuleGroupsOnSeparateLines != null) { stylerOptions.PutAttributeOrderRuleGroupsOnSeparateLines = options.PutAttributeOrderRuleGroupsOnSeparateLines.Value; } if (options.AttributeIndentation != null) { stylerOptions.AttributeIndentation = options.AttributeIndentation.Value; } if (options.AttributeIndentationStyle != null) { stylerOptions.AttributeIndentationStyle = options.AttributeIndentationStyle.Value; } if (options.RemoveDesignTimeReferences != null) { stylerOptions.RemoveDesignTimeReferences = options.RemoveDesignTimeReferences.Value; } if (options.EnableAttributeReordering != null) { stylerOptions.EnableAttributeReordering = options.EnableAttributeReordering.Value; } if (options.FirstLineAttributes != null) { stylerOptions.FirstLineAttributes = options.FirstLineAttributes; } if (options.OrderAttributesByName != null) { stylerOptions.OrderAttributesByName = options.OrderAttributesByName.Value; } if (options.PutEndingBracketOnNewLine != null) { stylerOptions.PutEndingBracketOnNewLine = options.PutEndingBracketOnNewLine.Value; } if (options.RemoveEndingTagOfEmptyElement != null) { stylerOptions.RemoveEndingTagOfEmptyElement = options.RemoveEndingTagOfEmptyElement.Value; } if (options.RootElementLineBreakRule != null) { stylerOptions.RootElementLineBreakRule = options.RootElementLineBreakRule.Value; } if (options.ReorderVSM != null) { stylerOptions.ReorderVSM = options.ReorderVSM.Value; } if (options.ReorderGridChildren != null) { stylerOptions.ReorderGridChildren = options.ReorderGridChildren.Value; } if (options.ReorderCanvasChildren != null) { stylerOptions.ReorderCanvasChildren = options.ReorderCanvasChildren.Value; } if (options.ReorderSetters != null) { stylerOptions.ReorderSetters = options.ReorderSetters.Value; } if (options.FormatMarkupExtension != null) { stylerOptions.FormatMarkupExtension = options.FormatMarkupExtension.Value; } if (options.NoNewLineMarkupExtensions != null) { stylerOptions.NoNewLineMarkupExtensions = options.NoNewLineMarkupExtensions; } if (options.ThicknessStyle != null) { stylerOptions.ThicknessStyle = options.ThicknessStyle.Value; } if (options.ThicknessAttributes != null) { stylerOptions.ThicknessAttributes = options.ThicknessAttributes; } if (options.CommentSpaces != null) { stylerOptions.CommentSpaces = options.CommentSpaces.Value; } }
public PackageOptions() { this.options = new StylerOptions(); }
public PackageOptions() { _options = new StylerOptions(); }
public CommentDocumentProcessor(IStylerOptions options, IndentService indentService) { this.options = options; this.indentService = indentService; }
public IndentService(IStylerOptions options) { this.indentWithTabs = options.IndentWithTabs; this.indentSize = options.IndentSize; this.attributeIndentationStyle = options.AttributeIndentationStyle; }