Partager via


IVsDataProvider.GetType Method (Guid, String)

Resolves a provider-specific type name to its corresponding Type representation, for a specific DDEX data source.

Namespace:  Microsoft.VisualStudio.Data.Core
Assembly:  Microsoft.VisualStudio.Data.Core (in Microsoft.VisualStudio.Data.Core.dll)

Syntax

'Declaration
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

Parameters

  • source
    Type: System.Guid

    A DDEX data source identifier.

Return Value

Type: System.Type
A Type object that represents the type that is resolved from the specified type name for the specified DDEX data source, if it is found; otherwise, nulla null reference (Nothing in Visual Basic).

Exceptions

Exception Condition
ArgumentNullException

The typeName parameter is nulla null reference (Nothing in Visual Basic).

[<ANY>]

The DDEX provider's GetType or GetType implementation threw an exception.

Remarks

This method checks whether the source parameter value is a non-empty GUID, and, if it is, calls the DDEX provider’s GetType method, if one exists. If no type is available at this point, it calls the GetType method.

Examples

The following code demonstrates how to call this method with a provider-specific type name and then create an instance of this type.

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;
    }
}

.NET Framework Security

See Also

Reference

IVsDataProvider Interface

GetType Overload

Microsoft.VisualStudio.Data.Core Namespace