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 } }
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; }
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 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); }
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; }
private string GetLocation(SDBookmark bookmark) { return(string.Format(StringParser.Parse("${res:MainWindow.Windows.BookmarkPad.LineText}"), Path.GetFileName(bookmark.FileName), bookmark.LineNumber)); }
protected override bool ShowBookmarkInThisPad(SDBookmark mark) { return(mark.ShowInPad(this) && mark is BreakpointBookmark); }
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; }