コード例 #1
0
		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);
		}
コード例 #2
0
 public void Add(ListViewPadItemModel item)
 {
     if (item == null)
     {
         return;
     }
     ItemCollection.Add(item);
 }
コード例 #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;
                }
            }
        }
コード例 #4
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;
				}
			}
		}
コード例 #5
0
		public void Add(ListViewPadItemModel item)
		{
			if (item == null) return;
			ItemCollection.Add(item);
		}
コード例 #6
0
ファイル: BookmarkPad.cs プロジェクト: lisiynos/pascalabcnet
		void AddMark(SDBookmark mark)
		{
			if (!ShowBookmarkInThisPad(mark))
				return;
			
			var model = new ListViewPadItemModel(mark);
			model.PropertyChanged += OnModelPropertyChanged;
			listView.Add(model);
		}
コード例 #7
0
ファイル: BookmarkPad.cs プロジェクト: lisiynos/pascalabcnet
		public void SelectItem(ListViewPadItemModel model)
		{
			listView.CurrentItem = model;
		}