IVsDataProvider.CreateObject 方法 (Guid, Type)

创建指定的 DDEX 支持实体的实例由 DDEX 提供程序实现的 DDEX 指定的数据源。

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

语法

声明
Function CreateObject ( _
    source As Guid, _
    objType As Type _
) As Object
Object CreateObject(
    Guid source,
    Type objType
)
Object^ CreateObject(
    Guid source, 
    Type^ objType
)
abstract CreateObject : 
        source:Guid * 
        objType:Type -> Object
function CreateObject(
    source : Guid, 
    objType : Type
) : Object

参数

  • source
    类型:Guid

    DDEX 数据源中没有特定数据源的标识符或 Empty

  • objType
    类型:Type

    DDEX 支持实体的类型。

返回值

类型:Object
指定的 DDEX 支持实体的实例由 DDEX 提供程序实现的 DDEX 指定的数据源。

异常

异常 条件
DataProviderException

提供程序不支持 DDEX 支持实体,或支持实体的新实例化的实例引发了异常,因为调用 CreateInstance 的方法通过反射或通过 DDEX 提供程序的 CreateObject 不合格的默认或客户端对象的实现的某个方法实现或创建一个 (如果有)。

备注

CreateObject 方法的委托,该方法将 Object 作为 TSite 泛参数值和 nullnull 引用(在 Visual Basic 中为 Nothing) 作为 site 参数。

.NET Framework 安全性

请参阅

参考

IVsDataProvider 接口

CreateObject 重载

Microsoft.VisualStudio.Data.Core 命名空间