Browse Source

Rename

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
6b901e7995
  1. 18
      Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs
  2. 2
      Debugger/ILSpy.Debugger/AvalonEdit/TextMarkerService.cs
  3. 2
      Debugger/ILSpy.Debugger/Bookmarks/BreakpointBookmark.cs
  4. 2
      Debugger/ILSpy.Debugger/Bookmarks/CurrentLineBookmark.cs
  5. 6
      Debugger/ILSpy.Debugger/DebuggedData.cs
  6. 2
      ILSpy/Commands/DebuggerCommands.cs
  7. 12
      ILSpy/TextView/DecompilerTextView.cs
  8. 2
      ILSpy/TreeNodes/MethodTreeNode.cs
  9. 2
      ILSpy/TreeNodes/PropertyTreeNode.cs
  10. 2
      ILSpy/TreeNodes/TypeTreeNode.cs

18
Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs

@ -59,7 +59,7 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit @@ -59,7 +59,7 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit
// create a dictionary line number => first bookmark
Dictionary<int, BookmarkBase> bookmarkDict = new Dictionary<int, BookmarkBase>();
foreach (var bm in BookmarkManager.Bookmarks) {
if (DebugData.CurrentMember == null || bm.Member.FullName != DebugData.CurrentMember.FullName)
if (DebugData.CurrentMemberReference == null || bm.Member.FullName != DebugData.CurrentMemberReference.FullName)
continue;
if (bm is BreakpointBookmark &&
((BreakpointBookmark)bm).Language != DebugData.Language)
@ -121,8 +121,8 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit @@ -121,8 +121,8 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit
BookmarkBase result = null;
foreach (BookmarkBase bm in BookmarkManager.Bookmarks) {
if (bm.LineNumber == line &&
DebugData.CurrentMember != null &&
bm.Member.FullName == DebugData.CurrentMember.FullName) {
DebugData.CurrentMemberReference != null &&
bm.Member.FullName == DebugData.CurrentMemberReference.FullName) {
if (result == null || bm.ZOrder > result.ZOrder)
result = bm;
}
@ -191,11 +191,11 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit @@ -191,11 +191,11 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit
InvalidateVisual();
}
if (DebugData.CurrentMember == null)
if (DebugData.CurrentMemberReference == null)
return;
BreakpointBookmark bm = BookmarkManager.Bookmarks.Find(
b => b.Member.FullName == DebugData.CurrentMember.FullName &&
b => b.Member.FullName == DebugData.CurrentMemberReference.FullName &&
b.LineNumber == GetLineFromMousePosition(e)
&& b is BreakpointBookmark) as BreakpointBookmark;
@ -228,22 +228,22 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit @@ -228,22 +228,22 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit
return;
}
if (e.ChangedButton == MouseButton.Left) {
if (DebugData.CurrentMember != null) {
if (DebugData.CurrentMemberReference != null) {
// check if the codemappings exists for this line
var storage = CodeMappings.GetStorage(DebugData.Language);
uint token;
var instruction = storage.GetInstructionByTypeAndLine(DebugData.CurrentMember.FullName, line, out token);
var instruction = storage.GetInstructionByTypeAndLine(DebugData.CurrentMemberReference.FullName, line, out token);
if (instruction == null) {
MessageBox.Show(string.Format("Missing code mappings for {0} at line {1}", DebugData.CurrentMember.FullName, line),
MessageBox.Show(string.Format("Missing code mappings for {0} at line {1}", DebugData.CurrentMemberReference.FullName, line),
"Code mappings", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
// no bookmark on the line: create a new breakpoint
DebuggerService.ToggleBreakpointAt(
DebugData.CurrentMember,
DebugData.CurrentMemberReference,
line,
DebugData.Language);
}

2
Debugger/ILSpy.Debugger/AvalonEdit/TextMarkerService.cs

@ -53,7 +53,7 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit @@ -53,7 +53,7 @@ namespace ICSharpCode.ILSpy.Debugger.AvalonEdit
{
if (e.Bookmark is MarkerBookmark) {
var bm = (MarkerBookmark)e.Bookmark;
if (DebugData.CurrentMember != null && DebugData.CurrentMember == bm.Member) {
if (DebugData.CurrentMemberReference != null && DebugData.CurrentMemberReference == bm.Member) {
// add bookmark for the current type
DocumentLine line = codeEditor.Document.GetLineByNumber(bm.LineNumber);
bm.CreateMarker(this, line.Offset, line.Length);

2
Debugger/ILSpy.Debugger/Bookmarks/BreakpointBookmark.cs

@ -91,7 +91,7 @@ namespace ICSharpCode.ILSpy.Debugger.Bookmarks @@ -91,7 +91,7 @@ namespace ICSharpCode.ILSpy.Debugger.Bookmarks
ITextMarker marker = markerService.Create(offset, length);
marker.BackgroundColor = Color.FromRgb(180, 38, 38);
marker.ForegroundColor = Colors.White;
marker.IsVisible = b => b is MarkerBookmark && ((MarkerBookmark)b).Member == DebugData.CurrentMember;
marker.IsVisible = b => b is MarkerBookmark && ((MarkerBookmark)b).Member == DebugData.CurrentMemberReference;
marker.Bookmark = this;
this.Marker = marker;

2
Debugger/ILSpy.Debugger/Bookmarks/CurrentLineBookmark.cs

@ -81,7 +81,7 @@ namespace ICSharpCode.ILSpy.Debugger.Bookmarks @@ -81,7 +81,7 @@ namespace ICSharpCode.ILSpy.Debugger.Bookmarks
ITextMarker marker = markerService.Create(offset + startColumn - 1, length + 1);
marker.BackgroundColor = Colors.Yellow;
marker.ForegroundColor = Colors.Blue;
marker.IsVisible = b => b is MarkerBookmark && ((MarkerBookmark)b).Member == DebugData.CurrentMember;
marker.IsVisible = b => b is MarkerBookmark && ((MarkerBookmark)b).Member == DebugData.CurrentMemberReference;
marker.Bookmark = this;
this.Marker = marker;
return marker;

6
Debugger/ILSpy.Debugger/DebuggedData.cs

@ -18,7 +18,7 @@ namespace ICSharpCode.ILSpy.Debugger @@ -18,7 +18,7 @@ namespace ICSharpCode.ILSpy.Debugger
/// <summary>
/// Gets or sets the current debugged member reference. Can be a type or a member of a type (method, property).
/// </summary>
public static MemberReference CurrentMember { get; set; }
public static MemberReference CurrentMemberReference { get; set; }
/// <summary>
/// Gets or sets the decompiled language.
@ -42,9 +42,9 @@ namespace ICSharpCode.ILSpy.Debugger @@ -42,9 +42,9 @@ namespace ICSharpCode.ILSpy.Debugger
/// <summary>
/// Returns true if the CurrentMember is a type (TypeDefinition). Otherwise, returns false (is MethodDefinition or PropertyDefinition).
/// </summary>
public static bool IsCurrentMemberType {
public static bool IsCurrentMemberReferenceType {
get {
return CurrentMember is TypeDefinition;
return CurrentMemberReference is TypeDefinition;
}
}

2
ILSpy/Commands/DebuggerCommands.cs

@ -163,7 +163,7 @@ namespace ICSharpCode.ILSpy.Commands @@ -163,7 +163,7 @@ namespace ICSharpCode.ILSpy.Commands
// jump to type & expand folding
if (CurrentLineBookmark.Instance != null) {
if (CurrentLineBookmark.Instance.Member != DebugData.CurrentMember)
if (CurrentLineBookmark.Instance.Member != DebugData.CurrentMemberReference)
MainWindow.Instance.JumpToReference(CurrentLineBookmark.Instance.Member);
MainWindow.Instance.TextView.UnfoldAndScroll(CurrentLineBookmark.Instance.LineNumber);

12
ILSpy/TextView/DecompilerTextView.cs

@ -378,7 +378,7 @@ namespace ICSharpCode.ILSpy.TextView @@ -378,7 +378,7 @@ namespace ICSharpCode.ILSpy.TextView
void DoDecompile(DecompilationContext context, int outputLengthLimit)
{
// reset type
DebugData.CurrentMember = null;
DebugData.CurrentMemberReference = null;
TextEditorListener.Instance.ClosePopup();
RunWithCancellation(
@ -407,24 +407,24 @@ namespace ICSharpCode.ILSpy.TextView @@ -407,24 +407,24 @@ namespace ICSharpCode.ILSpy.TextView
ShowOutput(output);
// reset type
DebugData.CurrentMember = null;
DebugData.CurrentMemberReference = null;
}
finally {
// set the language
DebugData.Language = MainWindow.Instance.sessionSettings.FilterSettings.Language.Name.StartsWith("IL") ? DecompiledLanguages.IL : DecompiledLanguages.CSharp;
if (DebugData.CurrentMember != null) {
if (DebugData.CurrentMemberReference != null) {
// TODO: show margin for single methods and properties
if (context.TreeNodes.Count() == 1 && DebugData.IsCurrentMemberType) {
if (context.TreeNodes.Count() == 1 && DebugData.IsCurrentMemberReferenceType) {
iconMargin.Visibility = Visibility.Visible;
// repaint bookmarks
iconMargin.InvalidateVisual();
// show the currentline marker
var bm = CurrentLineBookmark.Instance;
if (bm != null && DebugData.CurrentMember != null) {
if (DebugData.CurrentMember == bm.Member) {
if (bm != null && DebugData.CurrentMemberReference != null) {
if (DebugData.CurrentMemberReference == bm.Member) {
DocumentLine line = textEditor.Document.GetLineByNumber(bm.LineNumber);
bm.Marker = bm.CreateMarker(textMarkerService, line.Offset, line.Length);
}

2
ILSpy/TreeNodes/MethodTreeNode.cs

@ -124,7 +124,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -124,7 +124,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
DebugData.CurrentMember = method;
DebugData.CurrentMemberReference = method;
language.DecompileMethod(method, output, options);
}

2
ILSpy/TreeNodes/PropertyTreeNode.cs

@ -147,7 +147,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -147,7 +147,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
DebugData.CurrentMember = property;
DebugData.CurrentMemberReference = property;
language.DecompileProperty(property, output, options);
}

2
ILSpy/TreeNodes/TypeTreeNode.cs

@ -121,7 +121,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -121,7 +121,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
DebugData.CurrentMember = type;
DebugData.CurrentMemberReference = type;
language.DecompileType(type, output, options);
}

Loading…
Cancel
Save