private void DocumentRemoved(object sender, DocumentEventArgs e) { var codeDoc = e.Document as CodeDocument; if (codeDoc != null) control.RemoveDocumentNode(codeDoc); }
private void DocumentRemoved(object sender, DocumentEventArgs e) { var node = GetNode(e.Document); if (node != null) treeView.Nodes.Remove(node); }
private void DocumentAdded(object sender, DocumentEventArgs e) { var txtDoc = e.Document as TextDocument; AddDocument(txtDoc); }
private void DocumentAdded(object sender, DocumentEventArgs e) { AddDocument(e.Document as CodeDocument); }
private void DocumentAdded(object sender, DocumentEventArgs e) { var codeDoc = e.Document as CodeDocument; AddDocument(codeDoc); }
private void DocumentRemoved(object sender, DocumentEventArgs e) { var item = WB.Form.DocumentContainer.FindItemByTag(e.Document); WB.Form.DocumentContainer.RemoveDocument(item); WB.Form.DocumentContainer.Refresh(); }
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); } }
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(); }
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); }