IVisualizerObjectProvider.ReplaceData Method
Assembly: Microsoft.VisualStudio.DebuggerVisualizers (in microsoft.visualstudio.debuggervisualizers.dll)
Replaces the contents of the object being visualized with the contents of the data stream you specify. Sends the contents of the stream parameter to the ObjectSource class, for that class to do anything it needs with it.
Calling this method results in a call to CreateReplacementObject on the VisualizerObjectSource. The return value of the call will become the new object being visualized.
Replaces the contents of the object being visualized with the contents of the data stream you specify. Sends the contents of the stream parameter to the ObjectSource class, for that class to do anything it needs with it.
Calling this method results in a call to CreateReplacementObject on the VisualizerObjectSource. The return value of the call will become the new object being visualized.
public class DebuggerSide : DialogDebuggerVisualizer
{
override protected void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
Stream myStream = objectProvider.GetData();
Stream myNewStream;
// Here is where you would show the visualizer and deserialize
// Make sure the object is replacable before you try to replace
// it. Otherwise, you will get an exception.
if (objectProvider.IsObjectReplaceable)
{
// Reserialize here
objectProvider.ReplaceData(myNewStream);
}
}
// Other class methods would be here.
}
public class DebuggerSide : DialogDebuggerVisualizer
{
override protected void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
Stream myStream = objectProvider.GetData();
Stream myNewStream;
// Here is where you would show the visualizer and deserialize
// Make sure the object is replacable before you try to replace
// it. Otherwise, you will get an exception.
if (objectProvider.IsObjectReplaceable)
{
// Reserialize here
objectProvider.ReplaceData(myNewStream);
}
}
// Other class methods would be here.
}