public void Save(XElement root) { var s = (DisplaySettings)this.DataContext; var section = new XElement("DisplaySettings"); section.SetAttributeValue("Font", s.SelectedFont.Name); section.SetAttributeValue("FontSize", s.SelectedFontSize); section.SetAttributeValue("ShowLineNumbers", s.ShowLineNumbers); section.SetAttributeValue("ShowMetadataTokens", s.ShowMetadataTokens); section.SetAttributeValue("ShowMetadataTokensInBase10", s.ShowMetadataTokensInBase10); section.SetAttributeValue("EnableWordWrap", s.EnableWordWrap); section.SetAttributeValue("SortResults", s.SortResults); section.SetAttributeValue("FoldBraces", s.FoldBraces); section.SetAttributeValue("ExpandMemberDefinitions", s.ExpandMemberDefinitions); XElement existingElement = root.Element("DisplaySettings"); if (existingElement != null) { existingElement.ReplaceWith(section); } else { root.Add(section); } if (currentDisplaySettings != null) { currentDisplaySettings.CopyValues(s); } }
public void Save(XElement root) { DisplaySettings s = (DisplaySettings)this.DataContext; currentDisplaySettings.CopyValues(s); XElement section = new XElement("DisplaySettings"); section.SetAttributeValue("Font", s.SelectedFont.Source); section.SetAttributeValue("FontSize", s.SelectedFontSize); section.SetAttributeValue("ShowLineNumbers", s.ShowLineNumbers); section.SetAttributeValue("ShowMetadataTokens", s.ShowMetadataTokens); section.SetAttributeValue("EnableWordWrap", s.EnableWordWrap); XElement existingElement = root.Element("DisplaySettings"); if (existingElement != null) { existingElement.ReplaceWith(section); } else { root.Add(section); } }
public override RefreshFlags Save(XElement root) { DisplaySettings s = this.settings; var flags = RefreshFlags.None; if (currentDisplaySettings.ShowMetadataTokens != s.ShowMetadataTokens || currentDisplaySettings.ShowAssemblyVersion != s.ShowAssemblyVersion || currentDisplaySettings.ShowAssemblyPublicKeyToken != s.ShowAssemblyPublicKeyToken) { flags |= RefreshFlags.TreeViewNodes; } currentDisplaySettings.CopyValues(s); XElement section = new XElement("DisplaySettings"); section.SetAttributeValue("Font", SessionSettings.Escape(s.SelectedFont.Source)); section.SetAttributeValue("FontSize", s.SelectedFontSize); section.SetAttributeValue("ShowLineNumbers", s.ShowLineNumbers); section.SetAttributeValue("ShowMetadataTokens", s.ShowMetadataTokens); section.SetAttributeValue("ShowAssemblyVersion", s.ShowAssemblyVersion); section.SetAttributeValue("ShowAssemblyPublicKeyToken", s.ShowAssemblyPublicKeyToken); section.SetAttributeValue("DecompileFullType", s.DecompileFullType); section.SetAttributeValue("NewEmptyTabs", s.NewEmptyTabs); section.SetAttributeValue("RestoreTabsAtStartup", s.RestoreTabsAtStartup); section.SetAttributeValue("AutoHighlightRefs", s.AutoHighlightRefs); section.SetAttributeValue("SyntaxHighlightTreeViewUI", s.SyntaxHighlightTreeViewUI); section.SetAttributeValue("SyntaxHighlightAnalyzerTreeViewUI", s.SyntaxHighlightAnalyzerTreeViewUI); section.SetAttributeValue("SyntaxHighlightSearchListUI", s.SyntaxHighlightSearchListUI); section.SetAttributeValue("SingleClickExpandsChildren", s.SingleClickExpandsChildren); XElement existingElement = root.Element("DisplaySettings"); if (existingElement != null) { existingElement.ReplaceWith(section); } else { root.Add(section); } return(flags); }
public void Save(XElement root) { var s = (DisplaySettings)this.DataContext; var section = new XElement("DisplaySettings"); section.SetAttributeValue("Font", s.SelectedFont.Source); section.SetAttributeValue("FontSize", s.SelectedFontSize); section.SetAttributeValue("ShowLineNumbers", s.ShowLineNumbers); section.SetAttributeValue("ShowMetadataTokens", s.ShowMetadataTokens); section.SetAttributeValue("ShowMetadataTokensInBase10", s.ShowMetadataTokensInBase10); section.SetAttributeValue("ShowDebugInfo", s.ShowDebugInfo); section.SetAttributeValue("EnableWordWrap", s.EnableWordWrap); section.SetAttributeValue("SortResults", s.SortResults); section.SetAttributeValue("FoldBraces", s.FoldBraces); section.SetAttributeValue("ExpandMemberDefinitions", s.ExpandMemberDefinitions); section.SetAttributeValue("ExpandUsingDeclarations", s.ExpandUsingDeclarations); section.SetAttributeValue("IndentationUseTabs", s.IndentationUseTabs); section.SetAttributeValue("IndentationSize", s.IndentationSize); section.SetAttributeValue("IndentationTabSize", s.IndentationTabSize); section.SetAttributeValue("HighlightMatchingBraces", s.HighlightMatchingBraces); section.SetAttributeValue("HighlightCurrentLine", s.HighlightCurrentLine); section.SetAttributeValue("HideEmptyMetadataTables", s.HideEmptyMetadataTables); section.SetAttributeValue("UseNestedNamespaceNodes", s.UseNestedNamespaceNodes); section.SetAttributeValue("ShowRawOffsetsAndBytesBeforeInstruction", s.ShowRawOffsetsAndBytesBeforeInstruction); section.SetAttributeValue("StyleWindowTitleBar", s.StyleWindowTitleBar); XElement existingElement = root.Element("DisplaySettings"); if (existingElement != null) { existingElement.ReplaceWith(section); } else { root.Add(section); } if (currentDisplaySettings != null) { currentDisplaySettings.CopyValues(s); } }