static NavigationHistoryService() { IdeApp.Workspace.LastWorkspaceItemClosed += delegate { history.Clear(); OnHistoryChanged(); closedHistory.Clear(); OnClosedHistoryChanged(); }; IdeApp.Workbench.DocumentOpened += delegate(object sender, DocumentEventArgs e) { closedHistory.RemoveAll(np => (np.Item1 as DocumentNavigationPoint)?.FileName == e.Document.FileName); OnClosedHistoryChanged(); }; IdeApp.Workbench.DocumentClosing += delegate(object sender, DocumentEventArgs e) { NavigationPoint point = GetNavPointForDoc(e.Document, true) as DocumentNavigationPoint; if (point == null) { return; } closedHistory.Add(new Tuple <NavigationPoint, int> (point, IdeApp.Workbench.Documents.IndexOf(e.Document))); OnClosedHistoryChanged(); }; //keep nav points up to date TextEditorService.LineCountChanged += LineCountChanged; TextEditorService.LineCountChangesCommitted += CommitCountChanges; TextEditorService.LineCountChangesReset += ResetCountChanges; IdeApp.Workspace.FileRenamedInProject += FileRenamed; IdeApp.Workbench.ActiveDocumentChanged += ActiveDocChanged; }
public void Reset() { history.Clear(); OnHistoryChanged(); closedHistory.Clear(); OnClosedHistoryChanged(); }
static NavigationHistoryService () { IdeApp.Workspace.LastWorkspaceItemClosed += delegate { history.Clear (); OnHistoryChanged (); }; //keep nav points up to date MonoDevelop.Projects.Text.TextFileService.LineCountChanged += LineCountChanged; MonoDevelop.Projects.Text.TextFileService.CommitCountChanges += CommitCountChanges; MonoDevelop.Projects.Text.TextFileService.ResetCountChanges += ResetCountChanges; IdeApp.Workspace.FileRenamedInProject += FileRenamed; IdeApp.Workbench.ActiveDocumentChanged += ActiveDocChanged; }
static NavigationHistoryService() { IdeApp.Workspace.LastWorkspaceItemClosed += delegate { history.Clear(); OnHistoryChanged(); }; //keep nav points up to date TextEditorService.LineCountChanged += LineCountChanged; TextEditorService.LineCountChangesCommitted += CommitCountChanges; TextEditorService.LineCountChangesReset += ResetCountChanges; IdeApp.Workspace.FileRenamedInProject += FileRenamed; IdeApp.Workbench.ActiveDocumentChanged += ActiveDocChanged; }
static NavigationHistoryService() { IdeApp.Workspace.LastWorkspaceItemClosed += delegate { history.Clear(); OnHistoryChanged(); }; IdeApp.Workbench.DocumentClosed += delegate(object sender, DocumentEventArgs e) { ClosedDocumentNavigationPoint point = new ClosedDocumentNavigationPoint( e.Document.FileName, IdeApp.Workbench.Documents.IndexOf(IdeApp.Workbench.ActiveDocument) ); NavigationHistoryItem item = new NavigationHistoryItem(point); closedHistory.AddPoint(item); OnClosedHistoryChanged(); }; //keep nav points up to date TextEditorService.LineCountChanged += LineCountChanged; TextEditorService.LineCountChangesCommitted += CommitCountChanges; TextEditorService.LineCountChangesReset += ResetCountChanges; IdeApp.Workspace.FileRenamedInProject += FileRenamed; IdeApp.Workbench.ActiveDocumentChanged += ActiveDocChanged; }