Click or drag to resize

ExtensionsReflection Class

Provides a set of extensions used in reflection
Inheritance Hierarchy
SystemObject
  CauldronExtensionsReflection

Namespace:  Cauldron
Assembly:  Cauldron.Activator (in Cauldron.Activator.dll) Version: 3.2.0.2
Syntax
public static class ExtensionsReflection

The ExtensionsReflection type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAreReferenceAssignable
Returns a value that indicates whether the specified type can be assigned to the current type.
Public methodStatic memberCreateInstance(ConstructorInfo, Object)
Creates an instance of the specified type using the constructor
Public methodStatic memberCreateInstance(Type, Object)
Creates an instance of the specified type using the constructor that best matches the specified parameters.
Public methodStatic memberGetChildrenType
Public methodStatic memberGetCustomAttributeTAttib, TEnum
Gets the attribute of an enum member
Public methodStatic memberGetDefaultInstance
Retrieves the default value for a given Type.

http://stackoverflow.com/questions/2490244/default-value-of-a-type-at-runtime By Mark Jones

Public methodStatic memberGetDictionaryKeyValueTypes
Public methodStatic memberGetDisplayNameTEnum
Returns the name value of the DisplayNameAttribute of the enum member
Public methodStatic memberGetFieldsEx
Returns all the fields of the current Type, using the specified binding constraints including those of the base classes.
Public methodStatic memberGetMethod
Returns all the methods of the current Type, using the specified binding constraints including those of the base classes.
Public methodStatic memberGetMethodEx
Searches for the specified public method whose parameters match the specified argument types.
Public methodStatic memberGetMethodsEx
Returns all the methods of the current Type, using the specified binding constraints including those of the base classes.
Public methodStatic memberGetPropertiesEx
Returns all the properties of the current Type, using the specified binding constraints including those of the base classes.
Public methodStatic memberGetPropertyEx
Gets a specific property of the current Type.

This method will try to find the exact property if an AmbiguousMatchException occures

Public methodStatic memberGetPropertyFromPath
Tries to find a property defined by a path
Public methodStatic memberGetPropertyNonPublicValueT
Searches for the specified property, using the specified binding constraints and returns its value.

Default BindingFlags are Instance and NonPublic

Public methodStatic memberGetPropertyValue(Object, String, BindingFlags)
Searches for the specified property, using the specified binding constraints and returns its value.
Public methodStatic memberGetPropertyValueT(Object, String)
Searches for the specified property, using the specified binding constraints and returns its value.

Default BindingFlags are Instance and Public

Public methodStatic memberGetPropertyValueT(Object, String, BindingFlags)
Searches for the specified property, using the specified binding constraints and returns its value.
Public methodStatic memberGetValueTEnum
Returns the enum value from a display name. The enum members requires the DisplayNameAttribute. If non of the enum values has a matching DisplayName, then it will try to use TryParseTEnum(String, TEnum) to retrive a value; otherwise it will return the default value.

Returns the default value of the enum if value is null

Public methodStatic memberImplementsInterface(TypeInfo, Type)
Checks if the type has implemented the defined interface
Public methodStatic memberImplementsInterface(Type, Type)
Checks if the type has implemented the defined interface
Public methodStatic memberImplementsInterfaceT(TypeInfo)
Checks if the type has implemented the defined interface
Public methodStatic memberImplementsInterfaceT(Type)
Checks if the type has implemented the defined interface
Public methodStatic memberIsCollectionOrList
Checks if the type implements the ICollection or IList interface
Public methodStatic memberIsNullable
Public methodStatic memberMatchesArgumentTypes(MethodBase, Type)
Returns true if the argument types defined by argumentTypes matches with the argument types of method
Public methodStatic memberMatchesArgumentTypes(ParameterInfo, Type)
Returns true if the argument types defined by argumentTypes matches with the argument types of parameters
Top
See Also