public static void AddMark(BookmarkBase bookmark) { if (bookmark == null) return; if (bookmarks.Contains(bookmark)) return; if (bookmarks.Exists(b => IsEqualBookmark(b, bookmark))) return; bookmarks.Add(bookmark); OnAdded(new BookmarkEventArgs(bookmark)); }
public static void ReplaceMark(int index, BookmarkBase bookmark) { var removedBookmark = bookmarks[index]; bookmarks.RemoveAt(index); OnRemoved(new BookmarkEventArgs(removedBookmark)); bookmarks.Insert(index, bookmark); OnAdded(new BookmarkEventArgs(bookmark)); }
static bool IsEqualBookmark(BookmarkBase a, BookmarkBase b) { if (a == b) return true; if (a == null || b == null) return false; if (a.GetType() != b.GetType()) return false; if (a.MemberReference.FullName != b.MemberReference.FullName) return false; return a.LineNumber == b.LineNumber; }
public static void AddMark(BookmarkBase bookmark) { if (bookmark == null) { return; } if (bookmarks.Contains(bookmark)) { return; } bookmarks.Add(bookmark); OnAdded(new BookmarkEventArgs(bookmark)); }
static bool IsEqualBookmark(BookmarkBase a, BookmarkBase b) { if (a == b) { return(true); } if (a == null || b == null) { return(false); } if (a.GetType() != b.GetType()) { return(false); } if (a.MemberReference.FullName != b.MemberReference.FullName) { return(false); } return(a.LineNumber == b.LineNumber); }
public static void RemoveMark(BookmarkBase bookmark) { bookmarks.Remove(bookmark); OnRemoved(new BookmarkEventArgs(bookmark)); }
public BookmarkEventArgs(BookmarkBase bookmark) { this.bookmark = bookmark; }
public static void RemoveMark(BookmarkBase bookmark) { bookmarks.Remove(bookmark); OnRemoved(new BookmarkEventArgs(bookmark)); }
void GoToBookmark(BookmarkBase bm) { if (null == bm) return; if (Keyboard.Modifiers == ModifierKeys.Control || Keyboard.Modifiers == ModifierKeys.Shift) MainWindow.Instance.OpenNewEmptyTab(); var textView = MainWindow.Instance.SafeActiveTextView; if (DebugUtils.JumpToReference(textView, bm.MemberReference, () => bm.GetLocation(textView))) MainWindow.Instance.SetTextEditorFocus(textView); }
public BookmarkEventArgs(BookmarkBase bookmark) { this.bookmark = bookmark; }