ReflectionHelpers

Provides helper methods for reflection.

Namespace:
KpokPatagon.Reflection
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
Yes

Methods

GetAssemblies

Gets all assemblies availables.

Signature:
public Assembly[] GetAssemblies()

GetType

Gets the Type from the specied fullQualifiedTypeName.

Signature:
public Type GetType(fullQualifiedTypeName)
Returns

The Type.

Parameters
Name Type Summary
fullQualifiedTypeName String A full qualified type name.
Exceptions
Type Summary
FrameworkException

Thown when fullQualifiedTypeName could not ne parsed.

-or-

When the type could not be loaded.

TryGetType

Tries to get the specified fullQualifiedTypeName.

Signature:
public Type TryGetType(fullQualifiedTypeName)
Returns

A Type corresponding to the received argument or null if the type could not be loaded.

Remarks

This method uses reflection to load the type assembly for getting it's type.

Parameters
Name Type Summary
fullQualifiedTypeName String Full qualified type name string.

TryGetType

Try to get the type specified on fullQualifiedTypeName only if it is assignable from type .

Signature:
public Type TryGetType<T>(fullQualifiedTypeName)
Returns

A Type for the specified fullQualifiedTypeName.

Parameters
Name Type Summary
fullQualifiedTypeName String Full qualified type name.

TryGetTypeAndAssemblyNames

Parses a full qualified type name and assign the values of the type and assembly names to the specified variables.

Signature:
public Boolean TryGetTypeAndAssemblyNames(fullQualifiedTypeName, ref typeName, ref assemblyName)
Returns

true if the name could be parsed correctly, otherwise false.

Parameters
Name Type Summary
fullQualifiedTypeName String Full qualified type name.
typeName String& Type name extracted from fullQualifiedTypeName.
assemblyName String& Assembly name extracted from fullQualifiedTypeName.