IVisualizerObjectProvider.GetData 方法

命名空间:  Microsoft.VisualStudio.DebuggerVisualizers
程序集:  Microsoft.VisualStudio.DebuggerVisualizers(在 Microsoft.VisualStudio.DebuggerVisualizers.dll 中)

语法

声明
Function GetData As Stream
Stream GetData()
Stream^ GetData()
abstract GetData : unit -> Stream 
function GetData() : Stream

返回值

类型:System.IO.Stream
包含进行可视化处理的对象的内容的数据流。调用此方法会导致对 VisualizerObjectSource 调用 VisualizerObjectSource.GetData。然后该 GetData 调用的返回值会返回到此方法的调用方。

备注

GetObject 调用此方法并将流反序列化为对象。

示例

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 安全性

请参见

参考

IVisualizerObjectProvider 接口

Microsoft.VisualStudio.DebuggerVisualizers 命名空间