Browse Source

Show tooltip when debugging.

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
b46136786e
  1. 22
      Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs
  2. 1
      Debugger/ILSpy.Debugger/Bookmarks/BookmarkManager.cs
  3. 3
      Debugger/ILSpy.Debugger/Bookmarks/BreakpointBookmark.cs
  4. 2
      Debugger/ILSpy.Debugger/Bookmarks/CurrentLineBookmark.cs
  5. 1
      Debugger/ILSpy.Debugger/ILSpy.Debugger.csproj
  6. 9
      Debugger/ILSpy.Debugger/Services/Debugger/DebuggerService.cs
  7. 16
      Debugger/ILSpy.Debugger/Services/Debugger/IDebugger.cs
  8. 159
      Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs
  9. 6
      Debugger/ILSpy.Debugger/ToolTips/DebuggerTooltipControl.xaml.cs
  10. 3
      Debugger/ILSpy.Debugger/ToolTips/TextEditorListener.cs
  11. 9
      Debugger/ILSpy.Debugger/UI/AttachToProcessWindow.xaml.cs
  12. 4
      ILSpy/MainWindow.xaml
  13. 53
      ILSpy/MainWindow.xaml.cs
  14. 8
      ILSpy/TextView/DecompilerTextView.cs

22
Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs

@ -40,6 +40,12 @@ namespace ILSpy.Debugger.AvalonEdit @@ -40,6 +40,12 @@ namespace ILSpy.Debugger.AvalonEdit
set { currentTypeName = value; }
}
public IconBarMargin()
{
BookmarkManager.Added += delegate { InvalidateVisual(); };
BookmarkManager.Removed += delegate { InvalidateVisual(); };
}
public virtual void Dispose()
{
this.TextView = null; // detach from TextView (will also detach from manager)
@ -200,6 +206,13 @@ namespace ILSpy.Debugger.AvalonEdit @@ -200,6 +206,13 @@ namespace ILSpy.Debugger.AvalonEdit
dragStarted = true;
InvalidateVisual();
}
BreakpointBookmark bm = BookmarkManager.Bookmarks.Find(
b => b.TypeName == CurrentType.FullName &&
b.LineNumber == GetLineFromMousePosition(e)
&& b is BreakpointBookmark) as BreakpointBookmark;
this.ToolTip = (bm != null) ? bm.Tooltip : null;
}
protected override void OnMouseUp(MouseButtonEventArgs e)
@ -215,11 +228,11 @@ namespace ILSpy.Debugger.AvalonEdit @@ -215,11 +228,11 @@ namespace ILSpy.Debugger.AvalonEdit
CancelDragDrop();
}
if (!e.Handled && line != 0) {
IBookmark bm = GetBookmarkFromLine(line);
BookmarkBase bm = GetBookmarkFromLine(line);
if (bm != null) {
bm.MouseUp(e);
if (CurrentType != null) {
DebuggerService.ToggleBreakpointAt(CurrentType.FullName, line);
BookmarkManager.RemoveMark(bm);
}
InvalidateVisual();
if (e.Handled)
@ -228,7 +241,10 @@ namespace ILSpy.Debugger.AvalonEdit @@ -228,7 +241,10 @@ namespace ILSpy.Debugger.AvalonEdit
if (e.ChangedButton == MouseButton.Left) {
if (CurrentType != null) {
// no bookmark on the line: create a new breakpoint
DebuggerService.ToggleBreakpointAt(CurrentType.FullName, line);
DebuggerService.ToggleBreakpointAt(
CurrentType.FullName,
line,
DebuggerService.CurrentDebugger.Language);
}
}
InvalidateVisual();

1
Debugger/ILSpy.Debugger/Bookmarks/BookmarkManager.cs

@ -118,6 +118,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -118,6 +118,7 @@ namespace ILSpy.Debugger.Bookmarks
return;
}
}
// no bookmark at that line: create a new bookmark
BookmarkManager.AddMark(bookmarkFactory(new AstLocation(line, 0)));
}

3
Debugger/ILSpy.Debugger/Bookmarks/BreakpointBookmark.cs

@ -83,9 +83,10 @@ namespace ILSpy.Debugger.Bookmarks @@ -83,9 +83,10 @@ namespace ILSpy.Debugger.Bookmarks
set { tooltip = value; }
}
public BreakpointBookmark(string typeName, AstLocation location, BreakpointAction action) : base(typeName, location)
public BreakpointBookmark(string typeName, AstLocation location, BreakpointAction action, DecompiledLanguages language) : base(typeName, location)
{
this.action = action;
this.tooltip = language.ToString();
}
public override ImageSource Image {

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

@ -27,7 +27,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -27,7 +27,7 @@ namespace ILSpy.Debugger.Bookmarks
endLine = makerEndLine;
endColumn = makerEndColumn;
instance = new CurrentLineBookmark(typeName, new AstLocation(startColumn, startLine));
instance = new CurrentLineBookmark(typeName, new AstLocation(startLine, startColumn));
BookmarkManager.AddMark(instance);
}

1
Debugger/ILSpy.Debugger/ILSpy.Debugger.csproj

@ -114,6 +114,7 @@ @@ -114,6 +114,7 @@
<ItemGroup>
<Page Include="ToolTips\DebuggerTooltipControl.xaml" />
<Page Include="ToolTips\PinControlsDictionary.xaml" />
<Page Include="ToolTips\VisualizerPicker.xaml" />
<Page Include="UI\AttachToProcessWindow.xaml" />
</ItemGroup>
<ItemGroup>

9
Debugger/ILSpy.Debugger/Services/Debugger/DebuggerService.cs

@ -27,7 +27,7 @@ namespace ILSpy.Debugger.Services @@ -27,7 +27,7 @@ namespace ILSpy.Debugger.Services
static IDebugger GetCompatibleDebugger()
{
return new WindowsDebugger();
return currentDebugger = new WindowsDebugger();
}
/// <summary>
@ -166,12 +166,12 @@ namespace ILSpy.Debugger.Services @@ -166,12 +166,12 @@ namespace ILSpy.Debugger.Services
}
}
public static void ToggleBreakpointAt(string typeName, int lineNumber)
public static void ToggleBreakpointAt(string typeName, int lineNumber, DecompiledLanguages language)
{
BookmarkManager.ToggleBookmark(
typeName, lineNumber,
b => b.CanToggle && b is BreakpointBookmark,
location => new BreakpointBookmark(typeName, location, BreakpointAction.Break));
location => new BreakpointBookmark(typeName, location, BreakpointAction.Break, language));
}
/* TODO: reimplement this stuff
@ -210,8 +210,7 @@ namespace ILSpy.Debugger.Services @@ -210,8 +210,7 @@ namespace ILSpy.Debugger.Services
string variable =
ParserService.SimpleParseAt(doc.Text, doc.GetOffset(new TextLocation(logicPos.Line, logicPos.Column)));
if (currentDebugger == null || !currentDebugger.IsDebugging) {
if (currentDebugger == null || !currentDebugger.IsDebugging || !currentDebugger.CanEvaluate) {
e.ContentToShow = variable;
}
else {

16
Debugger/ILSpy.Debugger/Services/Debugger/IDebugger.cs

@ -9,8 +9,24 @@ using Mono.CSharp; @@ -9,8 +9,24 @@ using Mono.CSharp;
namespace ILSpy.Debugger.Services
{
public enum DecompiledLanguages
{
IL,
CSharp
}
public interface IDebugger : IDisposable
{
/// <summary>
/// Gets or sets the decompiled language.
/// </summary>
DecompiledLanguages Language { get; set; }
/// <summary>
/// Gets whether the debugger can evaluate the expression.
/// </summary>
bool CanEvaluate { get; }
/// <summary>
/// Returns true if debuger is attached to a process
/// </summary>

159
Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs

@ -99,6 +99,8 @@ namespace ILSpy.Debugger.Services @@ -99,6 +99,8 @@ namespace ILSpy.Debugger.Services
string errorProcessPaused = "Error.ProcessPaused";
string errorCannotStepNoActiveFunction = "Threads.CannotStepNoActiveFunction";
public DecompiledLanguages Language { get; set; }
public bool IsDebugging {
get {
return ServiceInitialized && debuggedProcess != null;
@ -372,7 +374,8 @@ namespace ILSpy.Debugger.Services @@ -372,7 +374,8 @@ namespace ILSpy.Debugger.Services
}
}
bool CanEvaluate
/// <inheritdoc/>
public bool CanEvaluate
{
get {
return debuggedProcess != null && !debuggedProcess.IsRunning && debuggedProcess.SelectedStackFrame != null;
@ -385,7 +388,7 @@ namespace ILSpy.Debugger.Services @@ -385,7 +388,7 @@ namespace ILSpy.Debugger.Services
/// </summary>
public object GetTooltipControl(AstLocation logicalPosition, string variableName)
{
return new DebuggerTooltipControl(logicalPosition, new ExpressionNode(ImageService.Breakpoint, variableName, null));
return new DebuggerTooltipControl(logicalPosition, new ExpressionNode(null, variableName, null));
//FIXME
// try {
// var tooltipExpression = GetExpression(variableName);
@ -489,12 +492,28 @@ namespace ILSpy.Debugger.Services @@ -489,12 +492,28 @@ namespace ILSpy.Debugger.Services
void AddBreakpoint(BreakpointBookmark bookmark)
{
uint token;
ILCodeMapping map = ILCodeMappings.GetInstructionByTypeAndLine(bookmark.TypeName, bookmark.LineNumber, out token);
Breakpoint breakpoint = null;
switch (Language) {
case DecompiledLanguages.IL:
uint token;
ILCodeMapping map = ILCodeMappings.GetInstructionByTypeAndLine(bookmark.TypeName, bookmark.LineNumber, out token);
if (map != null) {
Breakpoint breakpoint = new ILBreakpoint(debugger, bookmark.LineNumber, token, map.ILInstruction.Offset , bookmark.IsEnabled);
debugger.Breakpoints.Add(breakpoint);
if (map != null) {
breakpoint = new ILBreakpoint(debugger, bookmark.LineNumber, token, map.ILInstruction.Offset , bookmark.IsEnabled);
debugger.Breakpoints.Add(breakpoint);
}
break;
case DecompiledLanguages.CSharp:
break;
default:
throw new NotImplementedException("Not implemented!");
}
if (breakpoint == null)
return;
// Action setBookmarkColor = delegate {
// if (debugger.Processes.Count == 0) {
@ -525,64 +544,63 @@ namespace ILSpy.Debugger.Services @@ -525,64 +544,63 @@ namespace ILSpy.Debugger.Services
// }
// };
// event handlers on bookmark and breakpoint don't need deregistration
bookmark.IsEnabledChanged += delegate {
breakpoint.Enabled = bookmark.IsEnabled;
};
breakpoint.Set += delegate {
//setBookmarkColor();
};
// event handlers on bookmark and breakpoint don't need deregistration
bookmark.IsEnabledChanged += delegate {
breakpoint.Enabled = bookmark.IsEnabled;
};
breakpoint.Set += delegate {
//setBookmarkColor();
};
//setBookmarkColor();
EventHandler<CollectionItemEventArgs<Process>> bp_debugger_ProcessStarted = (sender, e) => {
//setBookmarkColor();
// User can change line number by inserting or deleting lines
breakpoint.Line = bookmark.LineNumber;
};
EventHandler<CollectionItemEventArgs<Process>> bp_debugger_ProcessExited = (sender, e) => {
//setBookmarkColor();
};
EventHandler<BreakpointEventArgs> bp_debugger_BreakpointHit =
new EventHandler<BreakpointEventArgs>(
delegate(object sender, BreakpointEventArgs e)
{
//LoggingService.Debug(bookmark.Action + " " + bookmark.ScriptLanguage + " " + bookmark.Condition);
EventHandler<CollectionItemEventArgs<Process>> bp_debugger_ProcessStarted = (sender, e) => {
//setBookmarkColor();
// User can change line number by inserting or deleting lines
breakpoint.Line = bookmark.LineNumber;
};
EventHandler<CollectionItemEventArgs<Process>> bp_debugger_ProcessExited = (sender, e) => {
//setBookmarkColor();
};
EventHandler<BreakpointEventArgs> bp_debugger_BreakpointHit =
new EventHandler<BreakpointEventArgs>(
delegate(object sender, BreakpointEventArgs e)
{
//LoggingService.Debug(bookmark.Action + " " + bookmark.ScriptLanguage + " " + bookmark.Condition);
switch (bookmark.Action) {
case BreakpointAction.Break:
break;
case BreakpointAction.Condition:
switch (bookmark.Action) {
case BreakpointAction.Break:
break;
case BreakpointAction.Condition:
// if (Evaluate(bookmark.Condition, bookmark.ScriptLanguage))
// DebuggerService.PrintDebugMessage(string.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Conditional.Breakpoints.BreakpointHitAtBecause}") + "\n", bookmark.LineNumber, bookmark.FileName, bookmark.Condition));
// else
// this.debuggedProcess.AsyncContinue();
break;
case BreakpointAction.Trace:
//DebuggerService.PrintDebugMessage(string.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Conditional.Breakpoints.BreakpointHitAt}") + "\n", bookmark.LineNumber, bookmark.FileName));
break;
}
});
BookmarkEventHandler bp_bookmarkManager_Removed = null;
bp_bookmarkManager_Removed = (sender, e) => {
if (bookmark == e.Bookmark) {
debugger.Breakpoints.Remove(breakpoint);
// unregister the events
debugger.Processes.Added -= bp_debugger_ProcessStarted;
debugger.Processes.Removed -= bp_debugger_ProcessExited;
breakpoint.Hit -= bp_debugger_BreakpointHit;
BookmarkManager.Removed -= bp_bookmarkManager_Removed;
}
};
// register the events
debugger.Processes.Added += bp_debugger_ProcessStarted;
debugger.Processes.Removed += bp_debugger_ProcessExited;
breakpoint.Hit += bp_debugger_BreakpointHit;
BookmarkManager.Removed += bp_bookmarkManager_Removed;
}
break;
case BreakpointAction.Trace:
//DebuggerService.PrintDebugMessage(string.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Conditional.Breakpoints.BreakpointHitAt}") + "\n", bookmark.LineNumber, bookmark.FileName));
break;
}
});
BookmarkEventHandler bp_bookmarkManager_Removed = null;
bp_bookmarkManager_Removed = (sender, e) => {
if (bookmark == e.Bookmark) {
debugger.Breakpoints.Remove(breakpoint);
// unregister the events
debugger.Processes.Added -= bp_debugger_ProcessStarted;
debugger.Processes.Removed -= bp_debugger_ProcessExited;
breakpoint.Hit -= bp_debugger_BreakpointHit;
BookmarkManager.Removed -= bp_bookmarkManager_Removed;
}
};
// register the events
debugger.Processes.Added += bp_debugger_ProcessStarted;
debugger.Processes.Removed += bp_debugger_ProcessExited;
breakpoint.Hit += bp_debugger_BreakpointHit;
BookmarkManager.Removed += bp_bookmarkManager_Removed;
}
bool Evaluate(string code, string language)
@ -723,13 +741,24 @@ namespace ILSpy.Debugger.Services @@ -723,13 +741,24 @@ namespace ILSpy.Debugger.Services
DebuggerService.RemoveCurrentLineMarker();
if (debuggedProcess != null && debuggedProcess.SelectedStackFrame != null) {
uint token = (uint)debuggedProcess.SelectedStackFrame.MethodInfo.MetadataToken;
int ilOffset = debuggedProcess.SelectedStackFrame.IP;
int line;
string typeName;
ILCodeMappings.GetSourceCodeFromMetadataTokenAndOffset(token, ilOffset, out typeName, out line);
if (typeName != null) {
DebuggerService.JumpToCurrentLine(typeName, line, 0, line, 0);
switch (Language) {
case DecompiledLanguages.IL:
// IL mapping
uint token = (uint)debuggedProcess.SelectedStackFrame.MethodInfo.MetadataToken;
int ilOffset = debuggedProcess.SelectedStackFrame.IP;
int line;
string typeName;
ILCodeMappings.GetSourceCodeFromMetadataTokenAndOffset(token, ilOffset, out typeName, out line);
if (typeName != null)
DebuggerService.JumpToCurrentLine(typeName, line, 0, line, 0);
break;
case DecompiledLanguages.CSharp:
// FIXME CSharp mappings
break;
default:
throw new NotImplementedException("The language is not supported!");
}
}
}

6
Debugger/ILSpy.Debugger/ToolTips/DebuggerTooltipControl.xaml.cs

@ -30,7 +30,7 @@ namespace ILSpy.Debugger.Tooltips @@ -30,7 +30,7 @@ namespace ILSpy.Debugger.Tooltips
private const int InitialItemsCount = 12;
private const int VisibleItemsCount = 11;
private bool showPins = true;
private bool showPins;
private LazyItemsControl<ITreeNode> lazyGrid;
private IEnumerable<ITreeNode> itemsSource;
readonly AstLocation logicalPosition;
@ -55,7 +55,7 @@ namespace ILSpy.Debugger.Tooltips @@ -55,7 +55,7 @@ namespace ILSpy.Debugger.Tooltips
this.itemsSource = nodes;
}
public DebuggerTooltipControl(DebuggerTooltipControl parentControl, AstLocation logicalPosition, bool showPins = true)
public DebuggerTooltipControl(DebuggerTooltipControl parentControl, AstLocation logicalPosition, bool showPins = false)
: this(logicalPosition)
{
this.parentControl = parentControl;
@ -65,7 +65,7 @@ namespace ILSpy.Debugger.Tooltips @@ -65,7 +65,7 @@ namespace ILSpy.Debugger.Tooltips
private void OnLoaded(object sender, RoutedEventArgs e)
{
if (!showPins) {
dataGrid.Columns[5].Visibility = Visibility.Collapsed;
dataGrid.Columns[4].Visibility = Visibility.Collapsed;
}
SetItemsSource(this.itemsSource);

3
Debugger/ILSpy.Debugger/ToolTips/TextEditorListener.cs

@ -68,9 +68,6 @@ namespace ILSpy.Debugger.ToolTips @@ -68,9 +68,6 @@ namespace ILSpy.Debugger.ToolTips
void OnMouseHoverStopped(MouseEventArgs e)
{
if (popup != null)
popup.IsOpen = false;
if (toolTip != null)
toolTip.IsOpen = false;
}

9
Debugger/ILSpy.Debugger/UI/AttachToProcessWindow.xaml.cs

@ -34,13 +34,6 @@ namespace ILSpy.Debugger.UI @@ -34,13 +34,6 @@ namespace ILSpy.Debugger.UI
/// </summary>
public partial class AttachToProcessWindow : Window
{
public static IDebugger Debugger { get; private set; }
static AttachToProcessWindow()
{
Debugger = new WindowsDebugger();
}
public AttachToProcessWindow()
{
InitializeComponent();
@ -92,7 +85,7 @@ namespace ILSpy.Debugger.UI @@ -92,7 +85,7 @@ namespace ILSpy.Debugger.UI
// start attaching
var process = ((RunningProcess)this.RunningProcesses.SelectedItem).Process;
Debugger.Attach(process);
DebuggerService.CurrentDebugger.Attach(process);
this.DialogResult = true;
}

4
ILSpy/MainWindow.xaml

@ -156,7 +156,9 @@ @@ -156,7 +156,9 @@
<Separator />
<ComboBox Name="languageComboBox" DisplayMemberPath="Name" Width="100"
ItemsSource="{x:Static local:Languages.AllLanguages}"
SelectedItem="{Binding FilterSettings.Language}" />
SelectedItem="{Binding FilterSettings.Language}"
SelectionChanged="LanguageComboBox_SelectionChanged"
/>
<Separator />
<Button x:Name="AttachButton" Command="routedCommands:RoutedUICommands.AttachToProcess" ToolTip="Attach to running process...">
<Image Width="16" Height="16" Source="Images/bug.png" />

53
ILSpy/MainWindow.xaml.cs

@ -27,13 +27,13 @@ using System.Threading.Tasks; @@ -27,13 +27,13 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.FlowAnalysis;
using ICSharpCode.ILSpy.TreeNodes;
using ICSharpCode.TreeView;
using ILSpy.Debugger.AvalonEdit;
using ILSpy.Debugger.Services;
using ILSpy.Debugger.UI;
using Microsoft.Win32;
using Mono.Cecil.Rocks;
@ -340,6 +340,17 @@ namespace ICSharpCode.ILSpy @@ -340,6 +340,17 @@ namespace ICSharpCode.ILSpy
treeView.FocusNode(lastNode);
}
void OpenFromGac_Click(object sender, RoutedEventArgs e)
{
OpenFromGacDialog dlg = new OpenFromGacDialog();
dlg.Owner = this;
if (dlg.ShowDialog() == true) {
OpenFiles(dlg.SelectedFileNames);
}
}
#endregion
#region Debugger commands
void RefreshCommandExecuted(object sender, ExecutedRoutedEventArgs e)
@ -352,7 +363,7 @@ namespace ICSharpCode.ILSpy @@ -352,7 +363,7 @@ namespace ICSharpCode.ILSpy
void AttachToProcessExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (!AttachToProcessWindow.Debugger.IsDebugging) {
if (!DebuggerService.CurrentDebugger.IsDebugging) {
var window = new AttachToProcessWindow();
window.Owner = this;
if (window.ShowDialog() == true)
@ -369,8 +380,8 @@ namespace ICSharpCode.ILSpy @@ -369,8 +380,8 @@ namespace ICSharpCode.ILSpy
void DetachFromProcessExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (AttachToProcessWindow.Debugger.IsDebugging){
AttachToProcessWindow.Debugger.Detach();
if (DebuggerService.CurrentDebugger.IsDebugging){
DebuggerService.CurrentDebugger.Detach();
AttachMenuItem.IsEnabled = AttachButton.IsEnabled = true;
ContinueDebuggingMenuItem.IsEnabled =
@ -383,26 +394,26 @@ namespace ICSharpCode.ILSpy @@ -383,26 +394,26 @@ namespace ICSharpCode.ILSpy
void ContinueDebuggingExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (AttachToProcessWindow.Debugger.IsDebugging)
AttachToProcessWindow.Debugger.Continue();
if (DebuggerService.CurrentDebugger.IsDebugging)
DebuggerService.CurrentDebugger.Continue();
}
void StepIntoExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (AttachToProcessWindow.Debugger.IsDebugging)
AttachToProcessWindow.Debugger.StepInto();
if (DebuggerService.CurrentDebugger.IsDebugging)
DebuggerService.CurrentDebugger.StepInto();
}
void StepOverExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (AttachToProcessWindow.Debugger.IsDebugging)
AttachToProcessWindow.Debugger.StepOver();
if (DebuggerService.CurrentDebugger.IsDebugging)
DebuggerService.CurrentDebugger.StepOver();
}
void StepOutExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (AttachToProcessWindow.Debugger.IsDebugging)
AttachToProcessWindow.Debugger.StepOut();
if (DebuggerService.CurrentDebugger.IsDebugging)
DebuggerService.CurrentDebugger.StepOut();
}
protected override void OnKeyUp(KeyEventArgs e)
@ -430,16 +441,6 @@ namespace ICSharpCode.ILSpy @@ -430,16 +441,6 @@ namespace ICSharpCode.ILSpy
#endregion
void OpenFromGac_Click(object sender, RoutedEventArgs e)
{
OpenFromGacDialog dlg = new OpenFromGacDialog();
dlg.Owner = this;
if (dlg.ShowDialog() == true) {
OpenFiles(dlg.SelectedFileNames);
}
}
#endregion
#region Exit/About
void ExitClick(object sender, RoutedEventArgs e)
{
@ -525,5 +526,11 @@ namespace ICSharpCode.ILSpy @@ -525,5 +526,11 @@ namespace ICSharpCode.ILSpy
sessionSettings.SplitterPosition = leftColumn.Width.Value / (leftColumn.Width.Value + rightColumn.Width.Value);
sessionSettings.Save();
}
void LanguageComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
DebuggerService.CurrentDebugger.Language =
sessionSettings.FilterSettings.Language.Name == "IL" ? DecompiledLanguages.IL : DecompiledLanguages.CSharp;
}
}
}

8
ILSpy/TextView/DecompilerTextView.cs

@ -87,16 +87,8 @@ namespace ICSharpCode.ILSpy.TextView @@ -87,16 +87,8 @@ namespace ICSharpCode.ILSpy.TextView
TextEditorWeakEventManager.MouseHover.AddListener(textEditor, TextEditorListener.Instance);
TextEditorWeakEventManager.MouseHoverStopped.AddListener(textEditor, TextEditorListener.Instance);
textEditor.TextArea.TextView.VisualLinesChanged += (s, e) => iconMargin.InvalidateVisual();
BookmarkManager.Added += BookmarkManager_Added;
BookmarkManager.Removed += (s, e) => iconMargin.InvalidateVisual();
}
void BookmarkManager_Added(object sender, BookmarkEventArgs e)
{
if (e.Bookmark is CurrentLineBookmark) {
iconMargin.InvalidateVisual();
}
}
#endregion
#region RunWithCancellation

Loading…
Cancel
Save