private void LoadPreferences(Preferences preferences) { var theme = ThemeViewModel.GetThemesList().FirstOrDefault(t => t.Name == preferences.Theme); if (theme == null) { theme = ThemeViewModel.GetThemesList()[0]; } SetTheme(theme); if (preferences.StartMaximized) { WindowState = System.Windows.WindowState.Maximized; } }
private void InitializeSqlHighlighting() { var themeName = MainWindow.Instance.Root.Configuration.Preferences.Theme; var theme = ThemeViewModel.GetThemesList().FirstOrDefault(t => t.Name == themeName); if (theme == null) { theme = ThemeViewModel.GetThemesList()[0]; } var xshd = "FMStudio.App.Themes.{0}.xshd".FormatInvariant(theme.SqlViewerResourceName); using (var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(xshd)) { var reader = new XmlTextReader(stream); txtSql.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.HighlightingLoader.Load(reader, ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance); } }