コード例 #1
0
ファイル: AbstractTextEditor.cs プロジェクト: ngoffee/ela
        public void OpenDocument(Document doc)
        {
            var newDoc = (TextDocument)doc;

            sci.AttachDocument(newDoc.GetSciDocument());
            try { sci.Select(); }
            catch { }
            sci.FistVisibleLine = newDoc.FirstVisibleLine;

            if (newDoc.Selections != null)
            {
                foreach (var s in newDoc.Selections)
                {
                    sci.AddSelection(s.End, s.Start, s.Main);
                }
            }

            OnDocumentOpened((T)doc);
        }
コード例 #2
0
ファイル: OutputControl.cs プロジェクト: ngoffee/ela
        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);
        }
コード例 #3
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));
                }
            }
        }
コード例 #4
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);
                }
            }
        }
コード例 #5
0
ファイル: TaskManager.cs プロジェクト: ngoffee/ela
        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));
                    }
                }
            }
        }