VisualizerDevelopmentHost 构造函数 (Object, Type, Type)

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

语法

声明
Public Sub New ( _
    objectToVisualize As Object, _
    visualizer As Type, _
    visualizerObjectSource As Type _
)
public VisualizerDevelopmentHost(
    Object objectToVisualize,
    Type visualizer,
    Type visualizerObjectSource
)
public:
VisualizerDevelopmentHost(
    Object^ objectToVisualize, 
    Type^ visualizer, 
    Type^ visualizerObjectSource
)
new : 
        objectToVisualize:Object * 
        visualizer:Type * 
        visualizerObjectSource:Type -> VisualizerDevelopmentHost
public function VisualizerDevelopmentHost(
    objectToVisualize : Object, 
    visualizer : Type, 
    visualizerObjectSource : Type
)

参数

  • objectToVisualize
    类型:System.Object
    要在可视化工具中显示的数据对象。例如,如果要测试 String 可视化工具,此参数则为要在可视化工具中显示的 String。

备注

用来创建可视化工具开发宿主的构造函数(使用要在其上测试可视化工具的数据对象和标识可视化工具类的类型)。

示例

// MyObjectSource is an object you derive from VisualizerObjectSource.
// Objects deriving from VisualizerObjectSource and VisualizerObjectProvider
// allow you to customize communication between the debugger and debuggee sides.
// For simple visualizers, you do not need to do this. 
public class MyObjectSource: VisualizerObjectSource
   {
     // ObjectSource methods ommitted for clarity.
   } 

// MyVisualizer is the class you write to create the visualizer 
public class MyVisualizer : DialogDebuggerVisualizer
{
   // Here is where you put the methods to show your visualizer.
   // They are ommitted here for clarity.
   // ...
...// The following method creates and shows the visualizer development host: 
   public static void TestShowVisualizer(object MyDataObject)
   {
      // This statement creates the host:
      VisualizerDevelopmentHost visualizerHost = new VisualizerDevelopmentHost (MyDataObject, typeof(MyVisualizer), typeof(MyObjectSource));
      // This statement calls the host to show the visualizer:
      visualizerHost.ShowVisualizer();
   }
}

.NET Framework 安全性

请参见

参考

VisualizerDevelopmentHost 类

VisualizerDevelopmentHost 重载

Microsoft.VisualStudio.DebuggerVisualizers 命名空间