IVsDataProvider.TryCreateObject 方法 (Type)

尝试创建的 DDEX 提供程序实现指定的 DDEX 支持实体的实例。

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

语法

声明
Function TryCreateObject ( _
    objType As Type _
) As Object
Object TryCreateObject(
    Type objType
)
Object^ TryCreateObject(
    Type^ objType
)
abstract TryCreateObject : 
        objType:Type -> Object
function TryCreateObject(
    objType : Type
) : Object

参数

  • objType
    类型:Type

    DDEX 支持实体的类型。

返回值

类型:Object
由 DDEX 提供程序实现指定的 DDEX 支持实体的实例,如果提供程序支持,DDEX 它;否则,返回 nullnull 引用(在 Visual Basic 中为 Nothing)。

异常

异常 条件
DataProviderException

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

备注

TryCreateObject 方法的委托,该方法将 Empty 作为 source 参数。

.NET Framework 安全性

请参阅

参考

IVsDataProvider 接口

TryCreateObject 重载

Microsoft.VisualStudio.Data.Core 命名空间