예제 #1
0
 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));
 }
예제 #2
0
        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));
        }
예제 #3
0
		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;
		}
예제 #4
0
 public static void AddMark(BookmarkBase bookmark)
 {
     if (bookmark == null)
     {
         return;
     }
     if (bookmarks.Contains(bookmark))
     {
         return;
     }
     bookmarks.Add(bookmark);
     OnAdded(new BookmarkEventArgs(bookmark));
 }
예제 #5
0
 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);
 }
예제 #6
0
 public static void RemoveMark(BookmarkBase bookmark)
 {
     bookmarks.Remove(bookmark);
     OnRemoved(new BookmarkEventArgs(bookmark));
 }
예제 #7
0
		public BookmarkEventArgs(BookmarkBase bookmark)
		{
			this.bookmark = bookmark;
		}
예제 #8
0
 public static void RemoveMark(BookmarkBase bookmark)
 {
     bookmarks.Remove(bookmark);
     OnRemoved(new BookmarkEventArgs(bookmark));
 }
예제 #9
0
 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;
 }