private void docManager_DocumentRemoved(object sender, DocumentEventArgs e) { for (int index = 0; index < tabs.Count; index++) { if (tabs[index].Document == e.Document) { tabs.RemoveAt(index); this.Invalidate(); return; } } }
//TODO: ez így nem szép! nem kéne internal! protected internal virtual void OnDocumentOpening(DocumentEventArgs e) { if (DocumentOpening != null) DocumentOpening(this, e); }
private void docManager_ActiveDocumentChanged(object sender, DocumentEventArgs e) { foreach (Tab tab in tabs) { if (tab.Document == docManager.ActiveDocument) { activeTab = tab; break; } } this.Invalidate(); }
private void docManager_DocumentAdded(object sender, DocumentEventArgs e) { Tab tab = new Tab(e.Document, this); tabs.Add(tab); }
protected virtual void OnActiveDocumentChanged(DocumentEventArgs e) { if (ActiveDocumentChanged != null) ActiveDocumentChanged(this, e); }
protected virtual void OnDocumentRemoved(DocumentEventArgs e) { if (DocumentRemoved != null) DocumentRemoved(this, e); }
private void docManager_ActiveDocumentChanged(object sender, DocumentEventArgs e) { if (docManager.HasDocument) { Workspace.Default.ActiveProject = docManager.ActiveDocument.Project; docManager.ActiveDocument.Modified += ActiveDocument_Modified; docManager.ActiveDocument.StatusChanged += ActiveDocument_StatusChanged; docManager.ActiveDocument.ClipboardAvailabilityChanged += ActiveDocument_ClipboardAvailabilityChanged; } else { Workspace.Default.ActiveProject = null; } IDocument oldDocument = e.Document; if (oldDocument != null) { oldDocument.Modified -= ActiveDocument_Modified; oldDocument.StatusChanged -= ActiveDocument_StatusChanged; oldDocument.ClipboardAvailabilityChanged -= ActiveDocument_ClipboardAvailabilityChanged; } UpdateStatusBar(); UpdateDynamicMenus(); UpdateClipboardToolBar(); UpdateStandardToolStrip(); }
private void modelExplorer_DocumentOpening(object sender, DocumentEventArgs e) { docManager.AddOrActivate(e.Document); }
private void OnDocumentRemoved(DocumentEventArgs e) { DocumentRemoved?.Invoke(this, e); }
private void OnActiveDocumentChanged(DocumentEventArgs e) { ActiveDocumentChanged?.Invoke(this, e); }
private void docManager_ActiveDocumentChanged(object sender, DocumentEventArgs e) { canvas.Document = docManager.ActiveDocument; }
protected virtual void OnDocumentRemoved(DocumentEventArgs e) { DocumentRemoved?.Invoke(this, e); }
protected virtual void OnActiveDocumentChanged(DocumentEventArgs e) { ActiveDocumentChanged?.Invoke(this, e); }