Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetData Method

IVisualizerObjectProvider.GetData Method

Namespace:  Microsoft.VisualStudio.DebuggerVisualizers
Assembly:  Microsoft.VisualStudio.DebuggerVisualizers (in Microsoft.VisualStudio.DebuggerVisualizers.dll)

Stream GetData()

Return Value

Type: System.IO.Stream
A stream of data containing the contents of the object being visualized. Calling this method results in VisualizerObjectSource.GetData being called on the VisualizerObjectSource. The return value of that GetData call is then returned to the caller of this method.

GetObject calls this method and deserializes the stream into an object.

public class DebuggerSide : DialogDebuggerVisualizer
   override protected void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
      Stream myStream = objectProvider.GetData();
      Stream myNewStream;
      // Here is where you would deserialize the data into a useful 
      // format and show the visualizer
      // Make sure the object is replacable before you try to replace 
      // it. Otherwise, you will get an exception.
      if (objectProvider.IsObjectReplaceable)
         // reserialize here
   // Other class methods would be here.

© 2015 Microsoft