Share via


IVisualizerObjectProvider.GetData Method

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

Syntax

'Declaration
Function GetData As Stream
Stream GetData()
Stream^ GetData()
abstract GetData : unit -> Stream
function GetData() : Stream

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.

Remarks

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

Examples

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.
}

.NET Framework Security

See Also

Reference

IVisualizerObjectProvider Interface

Microsoft.VisualStudio.DebuggerVisualizers Namespace