public static TextEditorConfig LoadFromRegistry(RegistryKey key) { return(new TextEditorConfig( indentation: key.GetIntOrDefault("Indentation", 4, minimumValue: 1, maximumValue: 99), indentationMode: key.GetEnumOrDefault <IndentationMode>("IndentationMode", IndentationMode.Tabs), useEditorConfig: key.GetBoolOrDefault("UseEditorConfig", true), showLineNumbers: key.GetBoolOrDefault("ShowLineNumbers", true), showWhitespace: key.GetBoolOrDefault("ShowWhitespace", false), wordWrap: key.GetBoolOrDefault("WordWrap", false), smartIndent: key.GetBoolOrDefault("SmartIndent", true), mainFontName: key.GetStringOrDefault("MainFontName", "Consolas"), mainFontSize: key.GetIntOrDefault("MainFontSize", 12, 1, 99), zoom: key.GetIntOrDefault("Zoom", 0, -10, +20) )); }
public static AppConfig LoadFromRegistry(RegistryKey key) { return(new AppConfig( theme: key.GetEnumOrDefault <ThemeKind>("Theme", ThemeKind.Light) )); }