How do I use my own debugger visualiser to edit variables runtime?
- by C Sharper
I'm writing my own debugger visualiser. All works great to show up to visualiser with the data.
Now I add the code for more clearness:
public class MyVisualiserObjectSource : VisualizerObjectSource
{
public override void GetData(object target, Stream outgoingData)
{
string data= target as string;
var writer = new StreamWriter(outgoingData);
writer.Write(data);
writer.Flush();
}
}
public class MyVirtualizer : DialogDebuggerVisualizer
{
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
var streamReader = new StreamReader(objectProvider.GetData());
string data = streamReader.ReadToEnd();
using (var form = new MyVirtualizerForm(data))
{
windowService.ShowDialog(form);
}
}
}
The string here is passed to the visualizer and show my own form. It works.
But now I want to pass back the modified data from the form to the variable.
How do I do that?
Edit:
I found out that I need to override the TransferData method in VisualizerObjectSource. But in the MSDN is no detail information about how I implement this correctly.
Can someone help me please?