예제 #1
0
        public static void ApplyStyle(this StyleItemConfig s, ScintillaControl sci)
        {
            var style = (Style)Reflect.GetPropertyValue(sci.Styles, s.Type);

            if (s.FontName != null)
                style.Font = s.FontName;

            if (s.FontSize != 0)
                style.FontSize = s.FontSize;

            if (s.ForeColor != null)
                style.ForeColor = Color.FromKnownColor(s.ForeColor.Value);

            if (s.BackColor != null)
                style.BackColor = Color.FromKnownColor(s.BackColor.Value);

            if (s.Bold != null)
                style.Bold = s.Bold.Value;

            if (s.Italic != null)
                style.Italic = s.Italic.Value;

            if (s.Underline != null)
                style.Underline = s.Underline.Value;
        }
예제 #2
0
 internal BackgroundCompiler(IApp app, ScintillaControl sci, IBackgroundCompiler compiler, BackgroundCompilerService service)
 {
     this.app = app;
     this.sci = sci;
     this.compiler = compiler;
     this.service = service;
 }
예제 #3
0
 private void AddBookmark(ScintillaControl sci, TreeNode parent, int line)
 {
     var txt = sci.GetLine(line).Text.TrimStart(' ', '\t');
     txt = !String.IsNullOrEmpty(txt) && txt.Length > 30 ? txt.Substring(0, 30) + "..." : txt;
     var tn = new TreeNode(String.Format("Line {0}: {1}", (line + 1), txt));
     tn.ImageKey = tn.SelectedImageKey = "Bookmark";
     tn.Tag = line;
     parent.Nodes.Add(tn);
     tn.ContextMenuStrip = contextMenu;
 }
예제 #4
0
        public static void UpdateStyles(this IEnumerable<StyleItemConfig> styles, ScintillaControl sci)
        {
            var def = styles.First(s => s.Type == "Default");
            def.ApplyStyle(sci);

            sci.ResetStyles();

            foreach (var s in styles.Where(t => t.Type != "Default"))
                s.ApplyStyle(sci);
        }
예제 #5
0
        internal BuildLogger(IApp app, Document doc, ScintillaControl sci, BuildOptions options)
        {
            this.app = app;
            this.doc = doc;
            this.sci = sci;
            this.options = options;

            app.CloseView("ErrorList");
            this.err = app.GetService<IErrorListService>();
            this.output = app.GetService<IOutputService>();
        }
예제 #6
0
        public OutputControl()
        {
            InitializeComponent();

            sci = new ScintillaControl();
            sci.Dock = DockStyle.Fill;
            sci.MarginVisible = false;
            sci.ViewWhiteSpace = false;
            sci.IndentationGuides = false;
            sci.UseTabs = false;
            sci.AttachDocument(sci.CreateDocument());
            sci.ReadOnly = true;
            sci.UseUnicodeLexing = true;
            panel.Controls.Add(sci);
        }
예제 #7
0
 internal FoldingManager(ScintillaControl sci)
 {
     this.sci = sci;
 }
예제 #8
0
 public OutputView()
 {
     this.control = new OutputControl();
     this.sci = control.Scintilla;
     this.sci.StyleNeeded += Lex;
 }
예제 #9
0
 public AutocompleteManager(IApp app, ScintillaControl sci)
 {
     this.app = app;
     this.sci = sci;
 }
예제 #10
0
        private void TreeViewBeforeExpand(object sender, TreeViewCancelEventArgs e)
        {
            e.Node.Nodes.Clear();

            var doc = e.Node.Tag as TextDocument;

            if (doc != null)
            {
                var sciDoc = doc.GetSciDocument();

                using (var sci = new ScintillaControl())
                {
                    sci.AttachDocument(sciDoc);
                    sci.GetAllBookmarks().ForEach(l => AddBookmark(sci, e.Node, l));
                }
            }
        }
예제 #11
0
        private void RemoveBookmark(TreeNode n)
        {
            if (n != null && n.Tag is Int32)
            {
                var i = (Int32)n.Tag;
                var doc = n.Parent.Tag as TextDocument;

                if (doc != null)
                {
                    var sciDoc = doc.GetSciDocument();

                    using (var sciTemp = new ScintillaControl())
                    {
                        sciTemp.AttachDocument(sciDoc);
                        sciTemp.RemoveBookmark(i);
                    }

                    treeView.Nodes.Remove(n);
                }
            }
        }
예제 #12
0
 public ConsoleTextBox(int historySize)
 {
     sci = new ScintillaControl();
     history = new HistoryList<String>(historySize);
     Initialize();
 }
예제 #13
0
 internal ElaFunctions(IApp app, ScintillaControl sci)
 {
     this.app = app;
     this.sci = sci;
 }
예제 #14
0
 private void AddTask(ScintillaControl sci, TreeNode parent, TaskItem task)
 {
     var txt = sci.GetTextRangeUnicode(task.Position, task.Position + task.Length).Trim(':', '-', '.', ' ', '\r', '\n');
     txt = !String.IsNullOrEmpty(txt) && txt.Length > 30 ? txt.Substring(0, 30) + "..." : txt;
     var tn = new TreeNode(String.Format("{0}: {1} ({2},{3})", task.Type.ToString().ToUpper(), txt,
         sci.GetLineFromPosition(task.Position) + 1, sci.GetColumnFromPosition(task.Position) + 1));
     tn.ImageKey = tn.SelectedImageKey = "Task";
     tn.Tag = task;
     parent.Nodes.Add(tn);
 }
예제 #15
0
        private void TreeViewBeforeExpand(object sender, TreeViewCancelEventArgs e)
        {
            e.Node.Nodes.Clear();
            var doc = e.Node.Tag as CodeDocument;

            if (doc != null)
            {
                var sciDoc = doc.GetSciDocument();

                using (var sci = new ScintillaControl())
                {
                    sci.AttachDocument(sciDoc);
                    var tp = service.GetTaskProvider(doc);

                    if (tp != null)
                    {
                        var tasks = tp.GetTasks(doc);
                        tasks.ForEach(t => AddTask(sci, e.Node, t));
                    }
                }
            }
        }