This topic has not yet been rated - Rate this topic

IVisualizerObjectProvider.ReplaceData Method 

Namespace: Microsoft.VisualStudio.DebuggerVisualizers
Assembly: Microsoft.VisualStudio.DebuggerVisualizers (in microsoft.visualstudio.debuggervisualizers.dll)

void ReplaceData (
	Stream newObjectData
)
void ReplaceData (
	Stream newObjectData
)
function ReplaceData (
	newObjectData : Stream
)

Parameters

newObjectData

A stream containing data to be used to create a new object, replacing the object currently 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.

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.
}
Did you find this helpful?
(1500 characters remaining)
Advertisement