共用方式為


IVisualizerObjectProvider.GetData 方法

更新:2007 年 11 月

命名空間:  Microsoft.VisualStudio.DebuggerVisualizers
組件:  Microsoft.VisualStudio.DebuggerVisualizers (在 Microsoft.VisualStudio.DebuggerVisualizers.dll 中)

語法

Function GetData As Stream

Dim instance As IVisualizerObjectProvider
Dim returnValue As Stream

returnValue = instance.GetData()
Stream GetData()
Stream^ GetData()
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.
}

使用權限

請參閱

參考

IVisualizerObjectProvider 介面

IVisualizerObjectProvider 成員

Microsoft.VisualStudio.DebuggerVisualizers 命名空間