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
    类型:System.Type
    DDEX的类型支持实体。

返回值

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

异常

异常 条件
DataProviderException

支持实体的新实例的实例引发了异常,还是 CreateInstance 的方式调用通过反射或通过DDEX提供程序的 CreateObject 方法失败的默认值或客户端对象的实现的实现或创建(如果有)。

备注

TryCreateObject 方法的此方法委托,通过 Empty 作为 source 参数值。

.NET Framework 安全性

请参见

参考

IVsDataProvider 接口

TryCreateObject 重载

Microsoft.VisualStudio.Data.Core 命名空间