I’ve created a VSIX
plugin with a custom window, subscribed to the DebuggerEvents.OnEnterBreakMode event
, and when the event occurs I try to access the _dte.Debugger.CurrentStackFrame.Locals
.
But this list contains only a string Value
property but no binary content and “real” data structure of the variable.
[Guid("a3f215c7-f47d-4560-8d26-b2c4815a5929")]
public class MyWindow : ToolWindowPane
{
public MyWindow() : base(null)
{
this.Caption = "MyWindow";
this.Content = new MyWindowControl();
}
}
public partial class MyWindowControl : UserControl
{
private readonly DTE _dte;
public MyWindowControl()
{
_dte = Package.GetGlobalService(typeof(DTE)) as DTE;
this.InitializeComponent();
Loaded += MyWindowControl_Loaded;
}
private void MyWindowControl_Loaded(object sender, RoutedEventArgs e)
{
_dte.Events.DebuggerEvents.OnEnterBreakMode -= DebuggerEvents_OnEnterBreakMode;
_dte.Events.DebuggerEvents.OnEnterBreakMode += DebuggerEvents_OnEnterBreakMode;
}
private void button1_Click(object sender, RoutedEventArgs e)
{
_dte.Events.DebuggerEvents.OnEnterBreakMode -= DebuggerEvents_OnEnterBreakMode;
_dte.Events.DebuggerEvents.OnEnterBreakMode += DebuggerEvents_OnEnterBreakMode;
}
private void DebuggerEvents_OnEnterBreakMode(dbgEventReason Reason, ref dbgExecutionAction ExecutionAction)
{
if (_dte.Debugger.CurrentStackFrame == null) return;
EnvDTE.Expressions locals = _dte.Debugger.CurrentStackFrame.Locals;
foreach (EnvDTE.Expression local in locals)
{
var val = local.Value;
// If the variable is of image type how can I access the data of the image to for example edit it or display it?
}
}
}
So my question is: if the variable is of image type how can I access the data of the image to for example edit it or display it?
2