public void Run(ListViewPadItemModel item)
		{
			var bookmarkBase = (BookmarkPadBase)Owner;	
			
			if (item == null) return;
			
			// get current mark
			var mark = item.Mark as SDBookmark;
			int line = mark.LineNumber;
			var fileName = new FileName(mark.FileName);
			
			SDBookmark bookmark;
			if (item.Mark is BreakpointBookmark) {
				var bookmarks = DebuggerService.Breakpoints;
				bookmark = bookmarks.FirstOrDefault(b => b.LineNumber == line && b.FileName == fileName);
				if (bookmark == null && bookmarks.Count > 0) {
					bookmark = bookmarks[0]; // jump around to first bookmark
				}
			}
			else {
				var bookmarks = BookmarkManager.Bookmarks;
				bookmark = bookmarks.FirstOrDefault(b => b.LineNumber == line && b.FileName == fileName);
				if (bookmark == null && bookmarks.Count > 0) {
					bookmark = bookmarks[0]; // jump around to first bookmark
				}
			}			
			
			if (bookmark != null) {
				FileService.JumpToFilePosition(bookmark.FileName, bookmark.LineNumber, bookmark.ColumnNumber);
			}	

			// select in tree
			bookmarkBase.SelectItem(item);
		}
Exemplo n.º 2
0
 public void Add(ListViewPadItemModel item)
 {
     if (item == null)
     {
         return;
     }
     ItemCollection.Add(item);
 }
Exemplo n.º 3
0
        public void Remove(ListViewPadItemModel item)
        {
            SDBookmark bookmark1 = item.Mark as SDBookmark;

            if (bookmark1 is CurrentLineBookmark)
            {
                return;
            }

            foreach (var line in itemCollection)
            {
                SDBookmark bookmark2 = line.Mark as SDBookmark;

                if (bookmark1.FileName == bookmark2.FileName &&
                    bookmark1.LineNumber == bookmark2.LineNumber)
                {
                    ItemCollection.Remove(line);
                    break;
                }
            }
        }
		public void Remove(ListViewPadItemModel item)
		{
			SDBookmark bookmark1 = item.Mark as SDBookmark;
			
			if (bookmark1 is CurrentLineBookmark)
				return;
			
			foreach (var line in itemCollection) {
				SDBookmark bookmark2 = line.Mark as SDBookmark;
				
				if (bookmark1.FileName == bookmark2.FileName &&
				    bookmark1.LineNumber == bookmark2.LineNumber) {
					ItemCollection.Remove(line);
					break;
				}
			}
		}
		public void Add(ListViewPadItemModel item)
		{
			if (item == null) return;
			ItemCollection.Add(item);
		}
Exemplo n.º 6
0
		void AddMark(SDBookmark mark)
		{
			if (!ShowBookmarkInThisPad(mark))
				return;
			
			var model = new ListViewPadItemModel(mark);
			model.PropertyChanged += OnModelPropertyChanged;
			listView.Add(model);
		}
Exemplo n.º 7
0
		public void SelectItem(ListViewPadItemModel model)
		{
			listView.CurrentItem = model;
		}