void OnTabStateRemoved(object sender, MainWindow.TabStateEventArgs e) { var tsd = e.TabState as DecompileTabState; if (tsd == null || tsd.TextView != decompilerTextView) { return; } BookmarkManager.Added -= OnBookmarkAdded; BookmarkManager.Removed -= OnBookmarkRemoved; decompilerTextView.OnShowOutput -= decompilerTextView_OnShowOutput; MainWindow.Instance.OnTabStateRemoved -= OnTabStateRemoved; }
void OnTabStateRemoved(object sender, MainWindow.TabStateEventArgs e) { var tsd = e.TabState as DecompileTabState; if (tsd == null || tsd.TextView != textView) { return; } TextView.DocumentChanged -= OnDocumentChanged; TextLineObjectManager.Instance.OnListModified -= TextLineObjectManager_OnListModified; MainWindow.Instance.OnTabStateRemoved -= OnTabStateRemoved; textView.OnShowOutput -= textView_OnShowOutput; ClearMarkers(); }
void OnTabStateRemoved(object sender, MainWindow.TabStateEventArgs e) { var tsd = e.TabState as DecompileTabState; if (tsd == null || tsd.TextView != textView) { return; } TextView.DocumentChanged -= OnDocumentChanged; BookmarkManager.Added -= BookmarkManager_Added; BookmarkManager.Removed -= BookmarkManager_Removed; MainWindow.Instance.OnTabStateRemoved -= OnTabStateRemoved; textView.OnShowOutput -= textView_OnShowOutput; foreach (var bm in BookmarkManager.Bookmarks) { var mbm = bm as MarkerBookmark; if (mbm != null) { mbm.Markers.Remove(this); } } }
void OnTabStateRemoved(object sender, MainWindow.TabStateEventArgs e) { OnTabStateRemoved(e.TabState); }