IVsDataProvider.GetType (Método) (Guid, String)
解决一特定于提供程序类型名称为其对应的 Type 表示。,特定 DDEX 数据源。
Espacio de nombres: Microsoft.VisualStudio.Data.Core
Ensamblado: Microsoft.VisualStudio.Data.Core (en Microsoft.VisualStudio.Data.Core.dll)
Sintaxis
'Declaración
Function GetType ( _
source As Guid, _
typeName As String _
) As Type
Type GetType(
Guid source,
string typeName
)
Type^ GetType(
Guid source,
String^ typeName
)
abstract GetType :
source:Guid *
typeName:string -> Type
function GetType(
source : Guid,
typeName : String
) : Type
Parámetros
source
Tipo: Guid数据源 DDEX 标识符。
typeName
Tipo: String一个提供程序特定的类型名称。
Valor devuelto
Tipo: Type
表示类型是从指定类型名称解析。指定的 DDEX 数据源的 Type 对象,如果找到,则为;否则,返回 nullreferencia null (Nothing en Visual Basic)。
Excepciones
Excepción | Condición |
---|---|
ArgumentNullException | typeName 参数为 nullreferencia null (Nothing en Visual Basic)。 |
[<ANY>] |
Comentarios
此方法检查参数值是否源为非空,GUID,如果是,DDEX 调用提供程序的 GetType 方法,因此,如果存在)。 如果类型此时不可用,它调用 GetType 方法。
Ejemplos
下面的代码演示如何调用带有一特定于提供程序类型名称 (此方法然后创建该类型的实例。
using System;
using Microsoft.VisualStudio.Data.Core;
using Microsoft.VisualStudio.Data.Services.SupportEntities;
public class DDEX_IVsDataProviderExample6
{
public static IVsDataObjectSelector CreateObjectSelector(
IVsDataProvider provider, string objectSelectorTypeName)
{
Type objectSelectorType = provider.GetType(objectSelectorTypeName);
return Activator.CreateInstance(objectSelectorType)
as IVsDataObjectSelector;
}
}
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.