Szerkesztés

Megosztás a következőn keresztül:


ITypeResolutionService.GetType Method

Definition

Loads a type with the specified name.

Overloads

GetType(String)

Loads a type with the specified name.

GetType(String, Boolean)

Loads a type with the specified name.

GetType(String, Boolean, Boolean)

Loads a type with the specified name.

GetType(String)

Loads a type with the specified name.

public:
 Type ^ GetType(System::String ^ name);
public Type GetType (string name);
public Type? GetType (string name);
abstract member GetType : string -> Type
Public Function GetType (name As String) As Type

Parameters

name
String

The name of the type. If the type name is not a fully qualified name that indicates an assembly, this service will search its internal set of referenced assemblies.

Returns

An instance of Type that corresponds to the specified name, or null if no type can be found.

Applies to

GetType(String, Boolean)

Loads a type with the specified name.

public:
 Type ^ GetType(System::String ^ name, bool throwOnError);
public Type GetType (string name, bool throwOnError);
public Type? GetType (string name, bool throwOnError);
abstract member GetType : string * bool -> Type
Public Function GetType (name As String, throwOnError As Boolean) As Type

Parameters

name
String

The name of the type. If the type name is not a fully qualified name that indicates an assembly, this service will search its internal set of referenced assemblies.

throwOnError
Boolean

true if this method should throw an exception if the assembly cannot be located; otherwise, false, and this method returns null if the assembly cannot be located.

Returns

An instance of Type that corresponds to the specified name, or null if no type can be found.

Remarks

If the type cannot be loaded and the throwOnError parameter is true, this will throw an exception.

Applies to

GetType(String, Boolean, Boolean)

Loads a type with the specified name.

public:
 Type ^ GetType(System::String ^ name, bool throwOnError, bool ignoreCase);
public Type GetType (string name, bool throwOnError, bool ignoreCase);
public Type? GetType (string name, bool throwOnError, bool ignoreCase);
abstract member GetType : string * bool * bool -> Type
Public Function GetType (name As String, throwOnError As Boolean, ignoreCase As Boolean) As Type

Parameters

name
String

The name of the type. If the type name is not a fully qualified name that indicates an assembly, this service will search its internal set of referenced assemblies.

throwOnError
Boolean

true if this method should throw an exception if the assembly cannot be located; otherwise, false, and this method returns null if the assembly cannot be located.

ignoreCase
Boolean

true to ignore case when searching for types; otherwise, false.

Returns

An instance of Type that corresponds to the specified name, or null if no type can be found.

Remarks

If the type cannot be loaded and the throwOnError parameter is true, this will throw an exception.

Applies to