public void Load() { var settings = (File.Exists(FileName)) ? _serializer.Value.DeserializeFromFile <ApplicationOptions>(FileName) : new ApplicationOptions(); Window = settings.Window; Project = settings.Project; Editor = settings.Editor; Loaded.Raise(this); }
public GherkinHighlightingDefinition(EditorOptions options) : base("Gherkin") { AddSpan(Gherkin.CommentExpression, @"$", options.CommentFontOptions); AddSpan(Gherkin.TagExpression, @"$", options.TagFontOptions); AddSpan(@"<", @">", options.ParametersFontOptions); var stringsColor = options.StringsFontOptions.ToHighlightingColor(); AddSpan(@"""", @"""", stringsColor); AddSpan(@"'", @"'", stringsColor); AddRule(Gherkin.FunctionExpression, options.FeatureKeywordFontOptions); AddRule(Gherkin.ReservedExpression, options.StepKeywordFontOptions); AddRule(@"(?<=\|)([^\|]*?)(?=\|)", options.TableFontOptions); }
public void SetEditor(EditorOptions editor) { if (_editor != null) { _editor.PropertyChanged -= OnEditorPropertyChanged; } _editor = editor; _editor.PropertyChanged += OnEditorPropertyChanged; Command.EditorWordWrap.Sync(); Command.EditorDisplayLineNumbers.Sync(); Command.EditorDisplaySymbols.Sync(); EditorSettingsChanged.Raise(this, ""); }
public EditorOptionsView(EditorOptions options) { InitializeComponent(); btnOk.Text = Strings.OkButtonText; btnCancel.Text = Strings.CancelButtonText; //ParentForm.AcceptButton = btnOk; //ParentForm.CancelButton = btnCancel; cbxFontFamily.DataSource = Fonts.SystemFontFamilies.Select(f => f.Source).ToList(); cbxFontSize.DataSource = Enumerable.Range(6, 18).Select(i => string.Format("{0}pt", i)).ToList(); SetEditorOptions(options); }
public ApplicationOptions() { Window = new WindowOptions(); Project = new ProjectOptions(); Editor = new EditorOptions(); }
public void SetEditor(EditorOptions editor) { if (_editor != null) _editor.PropertyChanged -= OnEditorPropertyChanged; _editor = editor; _editor.PropertyChanged += OnEditorPropertyChanged; Command.EditorWordWrap.Sync(); Command.EditorDisplayLineNumbers.Sync(); Command.EditorDisplaySymbols.Sync(); EditorSettingsChanged.Raise(this, ""); }
public ApplicationOptions() { Window = new WindowOptions(); Project = new ProjectOptions(); Editor = new EditorOptions(); }
private void SetEditorOptions(EditorOptions value) { cbxFontFamily.SelectedItem = value.FontFamily; cbxFontSize.SelectedItem = value.FontSize; focFontOptions.FontOptions = value.FontOptions; focCommentOptions.FontOptions = value.CommentFontOptions; focTagOptions.FontOptions = value.TagFontOptions; focParametersOptions.FontOptions = value.ParametersFontOptions; focStringsOptions.FontOptions = value.StringsFontOptions; focTableOptions.FontOptions = value.TableFontOptions; focFeatureKeywordOptions.FontOptions = value.FeatureKeywordFontOptions; focStepKeywordOptions.FontOptions = value.StepKeywordFontOptions; chkWordWrap.Checked = value.WordWrap; chkDisplayLineNumbers.Checked = value.DisplayLineNumbers; chkDisplaySymbols.Checked = value.DisplaySymbols; }
private EditorOptions GetEditorOptions() { var options = new EditorOptions { FontFamily = (string)cbxFontFamily.SelectedItem, FontSize = (string)cbxFontSize.SelectedItem, FontOptions = focFontOptions.FontOptions, CommentFontOptions = focCommentOptions.FontOptions, TagFontOptions = focTagOptions.FontOptions, ParametersFontOptions = focParametersOptions.FontOptions, StringsFontOptions = focStringsOptions.FontOptions, TableFontOptions = focTableOptions.FontOptions, FeatureKeywordFontOptions = focFeatureKeywordOptions.FontOptions, StepKeywordFontOptions = focStepKeywordOptions.FontOptions, WordWrap = chkWordWrap.Checked, DisplayLineNumbers = chkDisplayLineNumbers.Checked, DisplaySymbols = chkDisplaySymbols.Checked }; return options; }