0 out of 1 rated this helpful - Rate this topic

IVisualizerObjectProvider.GetData Method 

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

Stream GetData ()
Stream GetData ()
function GetData () : Stream

Return Value

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.

Return Value

A stream of data that contains 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.

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
         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 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
         objectProvider.ReplaceData(myNewStream); 
        }
   }
   // Other class methods would be here.
}
Did you find this helpful?
(1500 characters remaining)
Advertisement