internal DocumentTab AddDocument(DocumentView view, string filepath = null, bool restoreView = false) { DocumentTab tab = new DocumentTab(this, view, filepath, restoreView); tab.Closed += (sender, e) => _tabs.Remove(tab); tab.Activate(); _tabs.Add(tab); return tab; }
private void MainDock_ActiveDocumentChanged(object sender, EventArgs e) { if (MainDock.ActiveDocument == null) return; DockContent content = MainDock.ActiveDocument as DockContent; if (content.Tag is DocumentTab) { if (_activeTab != null) _activeTab.Deactivate(); _activeTab = content.Tag as DocumentTab; _activeTab.Activate(); } UpdateControls(); }