コード例 #1
0
        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);
        }
コード例 #2
0
 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);
 }
コード例 #3
0
 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, "");
 }
コード例 #4
0
        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);
        }
コード例 #5
0
 public ApplicationOptions()
 {
     Window  = new WindowOptions();
     Project = new ProjectOptions();
     Editor  = new EditorOptions();
 }
コード例 #6
0
 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, "");
 }
コード例 #7
0
 public ApplicationOptions()
 {
     Window = new WindowOptions();
     Project = new ProjectOptions();
     Editor = new EditorOptions();
 }
コード例 #8
0
 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;
 }
コード例 #9
0
 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;
 }