Example #1
0
 private AppSettings()
 {
     this.recentfiles = new List<string>();
     this.recentprojects = new List<string>();
     this.activeplugins = new List<string>();
     this.editorconfig = new CodeEditorConfig();
     this.lastworkingdir = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);
 }
Example #2
0
 private AppSettings()
 {
     this.recentfiles    = new List <string>();
     this.recentprojects = new List <string>();
     this.activeplugins  = new List <string>();
     this.editorconfig   = new CodeEditorConfig();
     this.lastworkingdir = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);
 }
        //apply custom style
        public static void ApplyUserStyle(Scintilla scintilla,CodeEditorConfig codeeditorcong )
        {
            Font userFont = new Font(codeeditorcong.Font, codeeditorcong.FontSize, codeeditorcong.FontStyle, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            //config-style line marging
            scintilla.Styles[STYLE_LINENUMBER].BackColor = Color.White;
            scintilla.Styles[STYLE_LINENUMBER].ForeColor = Color.DarkTurquoise;
            scintilla.Styles[STYLE_LINENUMBER].Bold = true;

            //apply user configuration
            scintilla.UseFont = true;
            scintilla.Font = userFont;
            scintilla.Styles[STYLE_LINENUMBER].Size =(float)codeeditorcong.FontSize;

            int Ratio = (int)codeeditorcong.FontSize;
            scintilla.Margins[LINENUMBER_MARGIN].Width = Ratio * scintilla.Lines.Count.ToString().Length + 4;

            scintilla.Folding.MarkerScheme = codeeditorcong.FoldingMarker;
            scintilla.Caret.HighlightCurrentLine = codeeditorcong.IsLineHilighting;
        }
Example #4
0
        public CodeEditor(CodeEditorConfig codeeditorconfg,string filepath)
        {
            InitializeComponent();
            CompletionImages = new ImageList();
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Keyword_icon);
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Namespace_icon);
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Class_icon);
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Structure_icon);
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Method_icon);
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Event_icon);
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Function_icon);
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Constant_icon);
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Enum_icon);
            CompletionImages.Images.Add(global::Moo.Properties.Resources.Var_icon);
            this.EditorView.AutoComplete.RegisterImages(CompletionImages,Color.Black);
            //this.EditorView.AutoComplete.

            Userconfig = codeeditorconfg;
            this.FilePath = filepath;
            this.Text = filepath;
            this.TabText = this.FileName;
        }