예제 #1
0
        private void DocumentRemoved(object sender, DocumentEventArgs e)
        {
            var codeDoc = e.Document as CodeDocument;

            if (codeDoc != null)
                control.RemoveDocumentNode(codeDoc);
        }
예제 #2
0
        private void DocumentRemoved(object sender, DocumentEventArgs e)
        {
            var node = GetNode(e.Document);

            if (node != null)
                treeView.Nodes.Remove(node);
        }
예제 #3
0
 private void DocumentAdded(object sender, DocumentEventArgs e)
 {
     var txtDoc = e.Document as TextDocument;
     AddDocument(txtDoc);
 }
예제 #4
0
 private void DocumentAdded(object sender, DocumentEventArgs e)
 {
     AddDocument(e.Document as CodeDocument);
 }
예제 #5
0
 private void DocumentAdded(object sender, DocumentEventArgs e)
 {
     var codeDoc = e.Document as CodeDocument;
     AddDocument(codeDoc);
 }
예제 #6
0
 private void DocumentRemoved(object sender, DocumentEventArgs e)
 {
     var item = WB.Form.DocumentContainer.FindItemByTag(e.Document);
     WB.Form.DocumentContainer.RemoveDocument(item);
     WB.Form.DocumentContainer.Refresh();
 }
예제 #7
0
        private void DocumentClosed(object sender, DocumentEventArgs e)
        {
            var active = App.Document();

            if (active == null || active.GetType() != e.Document.GetType())
            {
                WB.Form.DocumentPanel.Controls.Clear();
                WB.Form.DocumentPanel.Refresh();

                foreach (var i in WB.Form.MenuStrip.Items.OfType<ToolStripItem>().ToList().Where(m => ((Tag)m.Tag).Data == stub))
                    WB.Form.MenuStrip.Items.Remove(i);
            }
        }
예제 #8
0
 private void DocumentAdded(object sender, DocumentEventArgs e)
 {
     var doc = e.Document;
     Func<String> fun = () =>
     {
         var conf = App.Config<WorkbenchConfig>();
         var title = conf.FullFilePath ? doc.Title : new FileInfo(doc.Title).Name;
         return doc.IsDirty ? title + "*" : title;
     };
     WB.Form.DocumentContainer.AddDocument(fun, doc);
     WB.Form.DocumentContainer.Refresh();
 }
예제 #9
0
        private void ActiveDocumentChanged(object sender, DocumentEventArgs e)
        {
            var doc = e.Document;
            var editor = App.GetService<IEditorService>().GetEditor(doc.GetType());

            var ctl = (Control)editor.Instance.Control;

            if (ctl.CanSelect)
                ctl.Select();

            if (WB.Form.DocumentPanel.Controls.Count == 0 || WB.Form.DocumentPanel.Controls[0] != ctl)
            {
                ctl.Dock = DockStyle.Fill;
                WB.Form.DocumentPanel.Controls.Add(ctl);

                if (editor.Instance.Menu != null)
                {
                    var idx = 1;
                    var auxMenu = (MenuStrip)editor.Instance.Menu;
                    auxMenu.Items.OfType<ToolStripItem>().ToList().ForEach(i =>
                    {
                        ((Tag)i.Tag).Data = stub;
                        WB.Form.MenuStrip.Items.Insert(++idx, i);
                    });

                    WB.Form.MenuStrip.Renderer = new MenuRenderer();
                }
            }

            WB.Form.DocumentContainer.Refresh();
            WB.Form.UpdateWindowHeader();
            editor.Instance.OpenDocument(doc);
        }