Show / Hide Table of Contents

    Class ReflectionUtility

    This utility class is designed to make Cuemon.Reflection operations easier to work with.

    Inheritance
    System.Object
    ReflectionUtility
    Namespace: Cuemon.Reflection
    Assembly: Cuemon.Core.dll
    Syntax
    public static class ReflectionUtility

    Fields

    | Improve this Doc

    BindingInstancePublic

    Specifies that public instance members are to be included in the search.

    Declaration
    public static readonly BindingFlags BindingInstancePublic
    Field Value
    Type Description
    System.Reflection.BindingFlags
    Remarks

    Returns the the following System.Reflection.BindingFlags combination: BindingFlags.Instance | BindingFlags.Public.

    | Improve this Doc

    BindingInstancePublicAndPrivate

    Specifies that public and none-public instance members are to be included in the search.

    Declaration
    public static readonly BindingFlags BindingInstancePublicAndPrivate
    Field Value
    Type Description
    System.Reflection.BindingFlags
    Remarks

    Returns the the following System.Reflection.BindingFlags combination: BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic.

    | Improve this Doc

    BindingInstancePublicAndPrivateNoneInherited

    Specifies that public and none-public instance members are to be included in the search. Inherited members are excluded from the search.

    Declaration
    public static readonly BindingFlags BindingInstancePublicAndPrivateNoneInherited
    Field Value
    Type Description
    System.Reflection.BindingFlags
    Remarks

    Returns the the following System.Reflection.BindingFlags combination: BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly.

    | Improve this Doc

    BindingInstancePublicAndPrivateNoneInheritedIncludeStatic

    Specifies that public and none-public instance and static members are to be included in the search. Inherited members are excluded from the search.

    Declaration
    public static readonly BindingFlags BindingInstancePublicAndPrivateNoneInheritedIncludeStatic
    Field Value
    Type Description
    System.Reflection.BindingFlags
    Remarks

    Returns the the following System.Reflection.BindingFlags combination: BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly | BindingFlags.Static.

    Methods

    | Improve this Doc

    DefaultSkipPropertiesCallback(Type)

    A default callback implementation that evaluates if public property iteration should be skipped in the specified source type.

    Declaration
    public static bool DefaultSkipPropertiesCallback(Type source)
    Parameters
    Type Name Description
    System.Type source

    The source type to evaluate.

    Returns
    Type Description
    System.Boolean

    true if public property iteration should be skipped; otherwise false.

    | Improve this Doc

    DefaultSkipPropertyCallback(PropertyInfo)

    A default callback implementation that evaluates if the specified property should be skipped for further processing.

    Declaration
    public static bool DefaultSkipPropertyCallback(PropertyInfo property)
    Parameters
    Type Name Description
    System.Reflection.PropertyInfo property

    The property to evaluate.

    Returns
    Type Description
    System.Boolean

    true if the specified property should be skipped; otherwise false.

    | Improve this Doc

    GetAssemblyTypes(Assembly)

    Gets the types contained within the specified assembly.

    Declaration
    public static IEnumerable<Type> GetAssemblyTypes(Assembly assembly)
    Parameters
    Type Name Description
    System.Reflection.Assembly assembly

    The System.Reflection.Assembly to search the types from.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Type>

    A sequence of all System.Type elements from the specified assembly.

    | Improve this Doc

    GetAssemblyTypes(Assembly, String)

    Gets the types contained within the specified assembly.

    Declaration
    public static IEnumerable<Type> GetAssemblyTypes(Assembly assembly, string namespaceFilter)
    Parameters
    Type Name Description
    System.Reflection.Assembly assembly

    The System.Reflection.Assembly to search the types from.

    System.String namespaceFilter

    The namespace filter to apply on the types in the assembly.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Type>

    A sequence of System.Type elements, matching the applied filter, from the specified assembly.

    | Improve this Doc

    GetAssemblyTypes(Assembly, String, Type)

    Gets the types contained within the specified assembly.

    Declaration
    public static IEnumerable<Type> GetAssemblyTypes(Assembly assembly, string namespaceFilter, Type typeFilter)
    Parameters
    Type Name Description
    System.Reflection.Assembly assembly

    The System.Reflection.Assembly to search the types from.

    System.String namespaceFilter

    The namespace filter to apply on the types in the assembly.

    System.Type typeFilter

    The type filter to apply on the types in the assembly.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Type>

    A sequence of System.Type elements, matching the applied filters, from the specified assembly.

    | Improve this Doc

    GetConstructors(Type)

    Returns all the constructors of the specified source.

    Declaration
    public static IEnumerable<ConstructorInfo> GetConstructors(Type source)
    Parameters
    Type Name Description
    System.Type source

    The source to return constructors from.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo>

    A sequence of System.Reflection.ConstructorInfo objects representing a common search pattern of the specified source.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInherited.

    | Improve this Doc

    GetConstructors(Type, BindingFlags)

    Returns all the properties of the specified source.

    Declaration
    public static IEnumerable<ConstructorInfo> GetConstructors(Type source, BindingFlags bindings)
    Parameters
    Type Name Description
    System.Type source

    The source to return constructors from.

    System.Reflection.BindingFlags bindings

    A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo>

    A sequence of System.Reflection.ConstructorInfo objects representing the search pattern in bindings of the specified source.

    | Improve this Doc

    GetEmbeddedResource(Type, String)

    Loads the embedded resource from the associated System.Reflection.Assembly of the specified System.Type.

    Declaration
    public static Stream GetEmbeddedResource(Type source, string name)
    Parameters
    Type Name Description
    System.Type source

    The source type to load the resource from.

    System.String name

    The case-sensitive name of the resource being requested.

    Returns
    Type Description
    System.IO.Stream

    A System.IO.Stream representing the loaded resource; null if no resources were specified during compilation, or if the resource is not visible to the caller.

    | Improve this Doc

    GetEmbeddedResource(Type, String, ResourceMatch)

    Loads the embedded resource from the associated System.Reflection.Assembly of the specified System.Type.

    Declaration
    public static Stream GetEmbeddedResource(Type source, string name, ResourceMatch match)
    Parameters
    Type Name Description
    System.Type source

    The source type to load the resource from.

    System.String name

    The case-sensitive name of the resource being requested.

    ResourceMatch match

    The match ruleset to apply.

    Returns
    Type Description
    System.IO.Stream

    A System.IO.Stream representing the loaded resource; null if no resources were specified during compilation, or if the resource is not visible to the caller.

    | Improve this Doc

    GetEmbeddedResources(Type, String, ResourceMatch)

    Loads the embedded resources from the associated System.Reflection.Assembly of the specified System.Type following the ResourceMatch ruleset of match.

    Declaration
    public static IEnumerable<Stream> GetEmbeddedResources(Type source, string name, ResourceMatch match)
    Parameters
    Type Name Description
    System.Type source

    The source type to load the resource from.

    System.String name

    The name of the resource being requested.

    ResourceMatch match

    The match ruleset to apply.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.IO.Stream>

    A System.IO.Stream representing the loaded resources; null if no resources were specified during compilation, or if the resource is not visible to the caller.

    | Improve this Doc

    GetField(Type, String)

    Gets a specific field of the specified source.

    Declaration
    public static FieldInfo GetField(Type source, string fieldName)
    Parameters
    Type Name Description
    System.Type source

    The source to return a field from.

    System.String fieldName

    The name of the field to return.

    Returns
    Type Description
    System.Reflection.FieldInfo

    An object representing the field with the specified name, if found; otherwise, null.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInheritedIncludeStatic.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null -or- fieldName is null.

    ArgumentEmptyException

    fieldName is empty.

    | Improve this Doc

    GetField(Type, String, BindingFlags)

    Gets a specific field of the specified source.

    Declaration
    public static FieldInfo GetField(Type source, string fieldName, BindingFlags bindings)
    Parameters
    Type Name Description
    System.Type source

    The source to return a field from.

    System.String fieldName

    The name of the field to return.

    System.Reflection.BindingFlags bindings

    A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted.

    Returns
    Type Description
    System.Reflection.FieldInfo

    An object representing the field with the specified name, if found; otherwise, null.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null -or- fieldName is null.

    ArgumentEmptyException

    fieldName is empty.

    | Improve this Doc

    GetFields(Type)

    Returns all the fields of the specified source.

    Declaration
    public static IEnumerable<FieldInfo> GetFields(Type source)
    Parameters
    Type Name Description
    System.Type source

    The source to return fields from.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo>

    A sequence of System.Reflection.FieldInfo objects representing a common search pattern of the specified source.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInheritedIncludeStatic.

    | Improve this Doc

    GetFields(Type, BindingFlags)

    Returns all the fields of the specified source.

    Declaration
    public static IEnumerable<FieldInfo> GetFields(Type source, BindingFlags bindings)
    Parameters
    Type Name Description
    System.Type source

    The source to return fields from.

    System.Reflection.BindingFlags bindings

    A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo>

    A sequence of System.Reflection.FieldInfo objects representing the search pattern in bindings of the specified source.

    | Improve this Doc

    GetMethod(Type, String)

    Gets a specific method of the specified source.

    Declaration
    public static MethodInfo GetMethod(Type source, string methodName)
    Parameters
    Type Name Description
    System.Type source

    The source to return a method from.

    System.String methodName

    The name of the method to return.

    Returns
    Type Description
    System.Reflection.MethodInfo

    An object representing the method with the specified name, if found; otherwise, null.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInheritedIncludeStatic.

    | Improve this Doc

    GetMethod(Type, String, BindingFlags)

    Gets a specific method of the specified source.

    Declaration
    public static MethodInfo GetMethod(Type source, string methodName, BindingFlags bindings)
    Parameters
    Type Name Description
    System.Type source

    The source to return a method from.

    System.String methodName

    The name of the method to return.

    System.Reflection.BindingFlags bindings

    A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted.

    Returns
    Type Description
    System.Reflection.MethodInfo

    An object representing the method with the specified name, if found; otherwise, null.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null -or- methodName is null.

    ArgumentEmptyException

    methodName is empty.

    | Improve this Doc

    GetMethod(Type, String, Type[])

    Gets a specific method of the specified source.

    Declaration
    public static MethodInfo GetMethod(Type source, string methodName, Type[] methodSignature)
    Parameters
    Type Name Description
    System.Type source

    The source to return a method from.

    System.String methodName

    The name of the method to return.

    System.Type[] methodSignature

    An array of System.Type objects representing the number, order, and type of the parameters for the method to get.

    Returns
    Type Description
    System.Reflection.MethodInfo

    An object representing the method with the specified name, if found; otherwise, null.

    | Improve this Doc

    GetMethods(Type)

    Returns all the methods of the specified source.

    Declaration
    public static IEnumerable<MethodInfo> GetMethods(Type source)
    Parameters
    Type Name Description
    System.Type source

    The source to return methods from.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo>

    A sequence of System.Reflection.MethodInfo objects representing a common search pattern of the specified source.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInheritedIncludeStatic.

    | Improve this Doc

    GetMethods(Type, BindingFlags)

    Returns all the methods of the specified source.

    Declaration
    public static IEnumerable<MethodInfo> GetMethods(Type source, BindingFlags bindings)
    Parameters
    Type Name Description
    System.Type source

    The source to return methods from.

    System.Reflection.BindingFlags bindings

    A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo>

    A sequence of System.Reflection.MethodInfo objects representing the search pattern in bindings of the specified source.

    | Improve this Doc

    GetObjectHierarchy(Object, Action<ObjectHierarchyOptions>)

    Gets the tree structure of the specified source wrapped in an IHierarchy<T> node representing a hierarchical structure.

    Declaration
    public static IHierarchy<object> GetObjectHierarchy(object source, Action<ObjectHierarchyOptions> setup = null)
    Parameters
    Type Name Description
    System.Object source

    The source whose properties will be traversed while building the hierarchical structure.

    System.Action<ObjectHierarchyOptions> setup

    The ObjectHierarchyOptions which need to be configured.

    Returns
    Type Description
    IHierarchy<System.Object>

    An IHierarchy<T> node representing the entirety of a hierarchical structure from the specified source.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null.

    | Improve this Doc

    GetProperties(Type)

    Returns all the properties of the specified source.

    Declaration
    public static IEnumerable<PropertyInfo> GetProperties(Type source)
    Parameters
    Type Name Description
    System.Type source

    The source to return properties from.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo>

    A sequence of System.Reflection.PropertyInfo objects representing a common search pattern of the specified source.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInheritedIncludeStatic.

    | Improve this Doc

    GetProperties(Type, BindingFlags)

    Returns all the properties of the specified source.

    Declaration
    public static IEnumerable<PropertyInfo> GetProperties(Type source, BindingFlags bindings)
    Parameters
    Type Name Description
    System.Type source

    The source to return properties from.

    System.Reflection.BindingFlags bindings

    A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo>

    A sequence of System.Reflection.PropertyInfo objects representing the search pattern in bindings of the specified source.

    | Improve this Doc

    GetProperty(Type, String)

    Gets a specific property of the specified source.

    Declaration
    public static PropertyInfo GetProperty(Type source, string propertyName)
    Parameters
    Type Name Description
    System.Type source

    The source to return a property from.

    System.String propertyName

    The name of the property to return.

    Returns
    Type Description
    System.Reflection.PropertyInfo

    An object representing the property with the specified name, if found; otherwise, null.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInheritedIncludeStatic.

    | Improve this Doc

    GetProperty(Type, String, BindingFlags)

    Gets a specific property of the specified source.

    Declaration
    public static PropertyInfo GetProperty(Type source, string propertyName, BindingFlags bindings)
    Parameters
    Type Name Description
    System.Type source

    The source to return a property from.

    System.String propertyName

    The name of the property to return.

    System.Reflection.BindingFlags bindings

    A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted.

    Returns
    Type Description
    System.Reflection.PropertyInfo

    An object representing the property with the specified name, if found; otherwise, null.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null -or- propertyName is null.

    ArgumentEmptyException

    propertyName is empty.

    | Improve this Doc

    GetProperty(Type, String, Type)

    Gets a specific property of the specified source.

    Declaration
    public static PropertyInfo GetProperty(Type source, string propertyName, Type propertyReturnSignature)
    Parameters
    Type Name Description
    System.Type source

    The source to return a property from.

    System.String propertyName

    The name of the property to return.

    System.Type propertyReturnSignature

    The return System.Type of the property.

    Returns
    Type Description
    System.Reflection.PropertyInfo

    An object representing the property that matches the specified requirements, if found; otherwise, null.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInheritedIncludeStatic.

    | Improve this Doc

    GetProperty(Type, String, Type, Type[])

    Gets a specific property of the specified source.

    Declaration
    public static PropertyInfo GetProperty(Type source, string propertyName, Type propertyReturnSignature, Type[] propertySignature)
    Parameters
    Type Name Description
    System.Type source

    The source to return a property from.

    System.String propertyName

    The name of the property to return.

    System.Type propertyReturnSignature

    The return System.Type of the property.

    System.Type[] propertySignature

    An array of System.Type objects representing the number, order, and type of the parameters for the indexed property to get.

    Returns
    Type Description
    System.Reflection.PropertyInfo

    An object representing the property that matches the specified requirements, if found; otherwise, null.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInheritedIncludeStatic.

    | Improve this Doc

    GetPropertyAttributeDecorations<TDecoration>(Type)

    Gets a sequence of the specified TDecoration attribute, narrowed to property attribute decorations.

    Declaration
    public static IDictionary<PropertyInfo, TDecoration[]> GetPropertyAttributeDecorations<TDecoration>(Type source)
        where TDecoration : Attribute
    Parameters
    Type Name Description
    System.Type source

    The source type to locate TDecoration attributes in.

    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.Reflection.PropertyInfo, TDecoration[]>

    An System.Collections.Generic.IEnumerable<T> of the specified TDecoration attributes.

    Type Parameters
    Name Description
    TDecoration

    The type of the attribute to locate in source.

    Remarks

    Searches the source using the following System.Reflection.BindingFlags combination: BindingInstancePublicAndPrivateNoneInheritedIncludeStatic.

    | Improve this Doc

    GetPropertyAttributeDecorations<TDecoration>(Type, BindingFlags)

    Gets a sequence of the specified TDecoration attribute, narrowed to property attribute decorations.

    Declaration
    public static IDictionary<PropertyInfo, TDecoration[]> GetPropertyAttributeDecorations<TDecoration>(Type source, BindingFlags bindings)
        where TDecoration : Attribute
    Parameters
    Type Name Description
    System.Type source

    The source type to locate TDecoration attributes in.

    System.Reflection.BindingFlags bindings

    A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search is conducted.

    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.Reflection.PropertyInfo, TDecoration[]>

    An System.Collections.Generic.IEnumerable<T> of the specified TDecoration attributes.

    Type Parameters
    Name Description
    TDecoration

    The type of the attribute to locate in source.

    | Improve this Doc

    GetPropertyValue(Object, PropertyInfo)

    Gets the property value of a specified source.

    Declaration
    public static object GetPropertyValue(object source, PropertyInfo property)
    Parameters
    Type Name Description
    System.Object source

    The source whose property value will be returned.

    System.Reflection.PropertyInfo property

    The System.Reflection.PropertyInfo to access it's value from.

    Returns
    Type Description
    System.Object

    The property value of the specified source.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null - or - property is null.

    | Improve this Doc

    GetPropertyValue(Object, PropertyInfo, Func<ParameterInfo[], Object[]>)

    Gets the property value of a specified source with check for the need of property index values initialized by the specified propertyIndexParametersResolver.

    Declaration
    public static object GetPropertyValue(object source, PropertyInfo property, Func<ParameterInfo[], object[]> propertyIndexParametersResolver)
    Parameters
    Type Name Description
    System.Object source

    The source whose property value will be returned.

    System.Reflection.PropertyInfo property

    The System.Reflection.PropertyInfo to access it's value from.

    System.Func<System.Reflection.ParameterInfo[], System.Object[]> propertyIndexParametersResolver

    The function delegate that is invoked if a property has one or more index parameters.

    Returns
    Type Description
    System.Object

    The property value of the specified source.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null - or - property is null - or - propertyIndexParametersResolver is null.

    | Improve this Doc

    HasCircularReference<T>(T)

    Determines whether the specified source has a circular reference.

    Declaration
    public static bool HasCircularReference<T>(T source)
        where T : class
    Parameters
    Type Name Description
    T source

    The source to check for circular reference.

    Returns
    Type Description
    System.Boolean

    true if the specified source has a circular reference; otherwise, false.

    Type Parameters
    Name Description
    T

    The type of the source.

    | Improve this Doc

    HasCircularReference<T>(T, Int32)

    Determines whether the specified source has a circular reference.

    Declaration
    public static bool HasCircularReference<T>(T source, int maxDepth)
        where T : class
    Parameters
    Type Name Description
    T source

    The source to check for circular reference.

    System.Int32 maxDepth

    The maximum depth to traverse of source.

    Returns
    Type Description
    System.Boolean

    true if the specified source has a circular reference; otherwise, false.

    Type Parameters
    Name Description
    T

    The type of the source.

    | Improve this Doc

    HasCircularReference<T>(T, Int32, Func<ParameterInfo[], Object[]>)

    Determines whether the specified source has a circular reference.

    Declaration
    public static bool HasCircularReference<T>(T source, int maxDepth, Func<ParameterInfo[], object[]> propertyIndexParametersResolver)
        where T : class
    Parameters
    Type Name Description
    T source

    The source to check for circular reference.

    System.Int32 maxDepth

    The maximum depth to traverse of source.

    System.Func<System.Reflection.ParameterInfo[], System.Object[]> propertyIndexParametersResolver

    The function delegate that is invoked if a property has one or more index parameters.

    Returns
    Type Description
    System.Boolean

    true if the specified source has a circular reference; otherwise, false.

    Type Parameters
    Name Description
    T

    The type of the source.

    | Improve this Doc

    IsAutoProperty(PropertyInfo)

    Determines whether the specified property is considered an automatic property implementation.

    Declaration
    public static bool IsAutoProperty(PropertyInfo property)
    Parameters
    Type Name Description
    System.Reflection.PropertyInfo property

    The property to check for automatic property implementation.

    Returns
    Type Description
    System.Boolean

    true if the specified property is considered an automatic property implementation; otherwise, false.

    Exceptions
    Type Condition
    System.ArgumentNullException

    property is null.

    | Improve this Doc

    IsOverride(MethodInfo)

    Determines whether the specified method has been overridden.

    Declaration
    public static bool IsOverride(MethodInfo method)
    Parameters
    Type Name Description
    System.Reflection.MethodInfo method

    The method to evaluate has been overridden.

    Returns
    Type Description
    System.Boolean

    true if the specified method has been overridden; otherwise, false.

    | Improve this Doc

    IsOverride(PropertyInfo)

    Determines whether the specified property has been overridden.

    Declaration
    public static bool IsOverride(PropertyInfo property)
    Parameters
    Type Name Description
    System.Reflection.PropertyInfo property

    The property to evaluate has been overridden.

    Returns
    Type Description
    System.Boolean

    true if the specified property has been overridden; otherwise, false.

    | Improve this Doc

    ParseMethodParameters(Type, String, Object[])

    Parses and returns a collection of key/value pairs representing the specified methodName.

    Declaration
    public static IDictionary<string, object> ParseMethodParameters(Type source, string methodName, params object[] methodParameters)
    Parameters
    Type Name Description
    System.Type source

    The source to locate the specified methodName in.

    System.String methodName

    The name of the method to parse on source.

    System.Object[] methodParameters

    A variable number of values passed to the methodName on this instance.

    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Object>

    A collection of key/value pairs representing the specified methodName.

    Remarks

    This method will parse the specified methodName for parameter names and tie them with methodParameters.

    Exceptions
    Type Condition
    System.ArgumentNullException

    This exception is thrown if methodName is null, if source is null or if methodParameters is null and method has resolved parameters.

    ArgumentEmptyException

    This exception is thrown if methodName is empty.

    System.ArgumentException

    This exception is thrown if either of the following is true:
    the size of methodParameters does not match the resolved parameters size of methodName,
    the type of methodParameters does not match the resolved parameters type of methodName.

    | Improve this Doc

    ParseMethodParameters(Type, String, Type[], Object[])

    Parses and returns a collection of key/value pairs representing the specified methodName.

    Declaration
    public static IDictionary<string, object> ParseMethodParameters(Type source, string methodName, Type[] methodSignature, params object[] methodParameters)
    Parameters
    Type Name Description
    System.Type source

    The source to locate the specified methodName in.

    System.String methodName

    The name of the method to parse on source.

    System.Type[] methodSignature

    An array of System.Type objects representing the number, order, and type of the parameters for the method to get.

    System.Object[] methodParameters

    A variable number of values passed to the methodName on this instance.

    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Object>

    A collection of key/value pairs representing the specified methodName.

    Remarks

    This method will parse the specified methodName for parameter names and tie them with methodParameters.

    Exceptions
    Type Condition
    System.ArgumentNullException

    This exception is thrown if methodName is null, if source is null or if methodParameters is null and method has resolved parameters.

    ArgumentEmptyException

    This exception is thrown if methodName is empty.

    System.ArgumentException

    This exception is thrown if either of the following is true:
    the size of methodParameters does not match the resolved parameters size of methodName,
    the type of methodParameters does not match the resolved parameters type of methodName.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX