Exemplo n.º 1
0
        protected override void OnItemActivated(object sender, EventArgs e)
        {
            var node = CurrentItem;

            if (node == null)
            {
                return;
            }
            SDBookmark mark = node.Mark as SDBookmark;

            if (mark == null)
            {
                return;
            }

            string fileName = mark.FileName;

            if (mark is DecompiledBreakpointBookmark)
            {
                // get information from breakpoint and navigate to the decompiled type
                string assemblyFile, typeName;
                if (DecompiledBreakpointBookmark.GetAssemblyAndType(fileName, out assemblyFile, out typeName))
                {
                    NavigationService.NavigateTo(assemblyFile, typeName, string.Empty, mark.LineNumber, false);
                }
            }
            else
            {
                // jump to normal breakpoint
                FileService.JumpToFilePosition(fileName, mark.LineNumber, 1);

                // TODO: if other types of breakpoint bookmarks are available, one should do jumping/navigation here
            }
        }
Exemplo n.º 2
0
        public ListViewPadItemModel(SDBookmark mark)
        {
            if (mark is BreakpointBookmark)
            {
                isChecked = ((BreakpointBookmark)mark).IsEnabled;
                condition = ((BreakpointBookmark)mark).Condition;
                language  = ((BreakpointBookmark)mark).ScriptLanguage;
            }

            imageSource = mark.Image.ImageSource;

            Location = GetLocation(mark);
            Mark     = mark;
            tag      = this;
        }
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;
                }
            }
        }
Exemplo n.º 4
0
        public ListViewPadItemModel Remove(SDBookmark bookmark)
        {
            if (bookmark is CurrentLineBookmark)
            {
                return(null);
            }

            foreach (var model in itemCollection)
            {
                SDBookmark currentBookmark = model.Mark as SDBookmark;

                if (bookmark.FileName == currentBookmark.FileName &&
                    bookmark.LineNumber == currentBookmark.LineNumber)
                {
                    ItemCollection.Remove(model);
                    return(model);
                }
            }

            return(null);
        }
Exemplo n.º 5
0
 protected override bool ShowBookmarkInThisPad(SDBookmark mark)
 {
     return(mark.IsVisibleInBookmarkPad && mark is BreakpointBookmark);
 }
		private string GetLocation(SDBookmark bookmark)
		{
			return string.Format(StringParser.Parse("${res:MainWindow.Windows.BookmarkPad.LineText}"),
			                                        Path.GetFileName(bookmark.FileName), bookmark.LineNumber);
		}
		public ListViewPadItemModel(SDBookmark mark)
		{
			if (mark is BreakpointBookmark) {
				isChecked = ((BreakpointBookmark)mark).IsEnabled;
				condition = ((BreakpointBookmark)mark).Condition;
				language = ((BreakpointBookmark)mark).ScriptLanguage;
			}

			imageSource = mark.Image.ImageSource;
			
			Location = GetLocation(mark);
			Mark = mark;
			tag = this;
		}
Exemplo n.º 8
0
 private string GetLocation(SDBookmark bookmark)
 {
     return(string.Format(StringParser.Parse("${res:MainWindow.Windows.BookmarkPad.LineText}"),
                          Path.GetFileName(bookmark.FileName), bookmark.LineNumber));
 }
Exemplo n.º 9
0
 protected override bool ShowBookmarkInThisPad(SDBookmark mark)
 {
     return(mark.ShowInPad(this) && mark is BreakpointBookmark);
 }
Exemplo n.º 10
0
		public ListViewPadItemModel Remove(SDBookmark bookmark)
		{
			if (bookmark is CurrentLineBookmark)
				return null;
			
			foreach (var model in itemCollection) {
				SDBookmark currentBookmark = model.Mark as SDBookmark;
				
				if (bookmark.FileName == currentBookmark.FileName &&
				    bookmark.LineNumber == currentBookmark.LineNumber) {
					ItemCollection.Remove(model);
					return model;
				}
			}
			
			return null;
		}