Partager via


IVisualizerObjectProvider.GetData Method

Definition

Gets an initial blob of data about the object being debugged. The data is written into the provided MemoryStream.

public:
 System::IO::Stream ^ GetData();
public System.IO.Stream GetData ();
abstract member GetData : unit -> System.IO.Stream
Public Function GetData () As Stream

Returns

A stream of data that contains the contents of the object being visualized. Calling this method results in GetData(Object, Stream) being called on the VisualizerObjectSource. The return value of that GetData call is then returned to the caller of this method.

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

Remarks

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

Applies to