Partager via


DataProviderObjectFactory.GetType Method (String)

Resolves a provider-specific type name to its corresponding Type representation.

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

Syntax

'Declaration
Public Overridable Function GetType ( _
    typeName As String _
) As Type
public virtual Type GetType(
    string typeName
)
public:
virtual Type^ GetType(
    String^ typeName
)
abstract GetType : 
        typeName:string -> Type  
override GetType : 
        typeName:string -> Type
public function GetType(
    typeName : String
) : Type

Parameters

Return Value

Type: System.Type
A Type object representing the type resolved from the specified type name, if found; otherwise, nulla null reference (Nothing in Visual Basic).

Implements

IVsDataProviderObjectFactory.GetType(String)

Exceptions

Exception Condition
ArgumentNullException

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

Remarks

This method is useful when there are type names specified as strings in formats like a data support XML file, and these type names cannot be automatically resolved (or would be resolved incorrectly) by the CLR’s GetType method. One use of this method is to expand an unspecified namespace. (For example, if the string is "MyType", it might get expanded to "Company.Product.MyType" before the CLR resolves it.)

This method is provided to shorten a provider’s specification of type names, which can help reduce duplication of elements, like a common namespace, throughout the code base.

The base class implementation tries to locate a comma separating the type name from its qualifying assembly, and, if found, calls the GetAssembly method with the assembly qualifier and then, if found, tries to retrieve the type from this assembly. Otherwise it calls GetAssembly with an empty string and, if found, tries to get the type from this assembly. Finally, if the type is still not found, it calls the standard GetType method and returns the result of this call.

.NET Framework Security

See Also

Reference

DataProviderObjectFactory Class

GetType Overload

Microsoft.VisualStudio.Data.Framework Namespace