Inheritance: System.Windows.Forms.UserControl
示例#1
0
 private void InitSettings()
 {
     YnoteThemeReader.ApplyTheme(Globals.Settings.ThemeFile, Highlighter, codebox);
     codebox.AllowDrop = true;
     codebox.ShowScrollBars = Globals.Settings.ScrollBars;
     codebox.AutoCompleteBrackets = Globals.Settings.AutoCompleteBrackets;
     codebox.TabLength = Globals.Settings.TabSize;
     codebox.Font = new Font(Globals.Settings.FontFamily, Globals.Settings.FontSize);
     codebox.ShowFoldingLines = Globals.Settings.ShowFoldingLines;
     codebox.ShowLineNumbers = Globals.Settings.ShowLineNumbers;
     codebox.HighlightFoldingIndicator = Globals.Settings.HighlightFolding;
     codebox.FindEndOfFoldingBlockStrategy = Globals.Settings.FoldingStrategy;
     codebox.BracketsHighlightStrategy = Globals.Settings.BracketsStrategy;
     codebox.CaretVisible = Globals.Settings.ShowCaret;
     codebox.ShowFoldingLines = Globals.Settings.ShowFoldingLines;
     codebox.LineInterval = Globals.Settings.LineInterval;
     codebox.LeftPadding = Globals.Settings.PaddingWidth;
     codebox.VirtualSpace = Globals.Settings.EnableVirtualSpace;
     codebox.WideCaret = Globals.Settings.BlockCaret;
     codebox.WordWrap = Globals.Settings.WordWrap;
     codebox.Zoom = Globals.Settings.Zoom;
     codebox.HotkeysMapping =
         HotkeysMapping.Parse(File.ReadAllText(GlobalSettings.SettingsDir + "Editor.ynotekeys"));
     if (Globals.Settings.ImeMode)
         codebox.ImeMode = ImeMode.On;
     if (Globals.Settings.ShowChangedLine)
         codebox.ChangedLineColor = ControlPaint.LightLight(codebox.CurrentLineColor);
     if (Globals.Settings.ShowDocumentMap)
     {
         CreateDocumentMap();
     }
     if (Globals.Settings.WrapWidth > 0)
     {
         codebox.WordWrapMode = WordWrapMode.WordWrapPreferredWidth;
         codebox.PreferredLineWidth = Globals.Settings.WrapWidth;
     }
     if (!Globals.Settings.ShowRuler) return;
     var ruler = new Ruler
     {
         Dock = DockStyle.Top,
         Location = new Point(0, 0),
         Size = new Size(284, 24),
         TabIndex = 1,
         Target = codebox
     };
     Controls.Add(ruler);
 }