Show / Hide Table of Contents

    Class MethodDescriptor

    Provides information about a method, such as its name, parameters and whether its a property or method.

    Inheritance
    System.Object
    MethodDescriptor
    Namespace: Cuemon.Reflection
    Assembly: Cuemon.Core.dll
    Syntax
    public sealed class MethodDescriptor

    Constructors

    | Improve this Doc

    MethodDescriptor(MethodBase)

    Initializes a new instance of the MethodDescriptor class.

    Declaration
    public MethodDescriptor(MethodBase method)
    Parameters
    Type Name Description
    System.Reflection.MethodBase method

    The method to extract a signature for.

    Exceptions
    Type Condition
    System.ArgumentNullException

    method is null.

    | Improve this Doc

    MethodDescriptor(Type, MethodBase)

    Initializes a new instance of the MethodDescriptor class.

    Declaration
    public MethodDescriptor(Type caller, MethodBase method)
    Parameters
    Type Name Description
    System.Type caller

    The class on which the method resides.

    System.Reflection.MethodBase method

    The method to extract a signature for.

    Exceptions
    Type Condition
    System.ArgumentNullException

    method is null.

    | Improve this Doc

    MethodDescriptor(Type, String)

    Initializes a new instance of the MethodDescriptor class.

    Declaration
    public MethodDescriptor(Type caller, string methodName)
    Parameters
    Type Name Description
    System.Type caller

    The class on which the methodName resides.

    System.String methodName

    The name of the method.

    Remarks

    This represents a method with no parameters.

    | Improve this Doc

    MethodDescriptor(Type, String, ParameterSignature[])

    Initializes a new instance of the MethodDescriptor class.

    Declaration
    public MethodDescriptor(Type caller, string methodName, params ParameterSignature[] parameters)
    Parameters
    Type Name Description
    System.Type caller

    The class on which the methodName resides.

    System.String methodName

    The name of the method.

    ParameterSignature[] parameters

    A sequence of ParameterSignature that represent the parameter signature of the method.

    Remarks

    This represents a method with one or more parameters.

    | Improve this Doc

    MethodDescriptor(Type, String, Boolean)

    Initializes a new instance of the MethodDescriptor class.

    Declaration
    public MethodDescriptor(Type caller, string methodName, bool isProperty)
    Parameters
    Type Name Description
    System.Type caller

    The class on which the methodName resides.

    System.String methodName

    The name of the method.

    System.Boolean isProperty

    A value indicating whether the method is a property. Default is false.

    Remarks

    This represents a method with no parameters or a normal property.

    | Improve this Doc

    MethodDescriptor(Type, String, Boolean, ParameterSignature[])

    Initializes a new instance of the MethodDescriptor class.

    Declaration
    public MethodDescriptor(Type caller, string methodName, bool isProperty, params ParameterSignature[] parameters)
    Parameters
    Type Name Description
    System.Type caller

    The class on which the methodName resides.

    System.String methodName

    The name of the method.

    System.Boolean isProperty

    A value indicating whether the method is a property. Default is false.

    ParameterSignature[] parameters

    A sequence of ParameterSignature that represent the parameter signature of the method.

    Remarks

    This represents a method with one or more parameters or a property indexer.

    Exceptions
    Type Condition
    System.ArgumentNullException

    caller is null or
    methodName is null.

    ArgumentEmptyException

    caller is empty or
    methodName is empty.

    Properties

    | Improve this Doc

    Caller

    Gets the name of the class where the method is located.

    Declaration
    public Type Caller { get; }
    Property Value
    Type Description
    System.Type

    The name of the class where the method is located.

    | Improve this Doc

    HasParameters

    Gets a value indicating whether the method has parameters.

    Declaration
    public bool HasParameters { get; }
    Property Value
    Type Description
    System.Boolean

    true if the method has parameters; otherwise, false.

    | Improve this Doc

    IsProperty

    Gets a value indicating whether the method is a property.

    Declaration
    public bool IsProperty { get; }
    Property Value
    Type Description
    System.Boolean

    true if the method is a property; otherwise, false.

    | Improve this Doc

    MethodName

    Gets the name of the method.

    Declaration
    public string MethodName { get; }
    Property Value
    Type Description
    System.String

    The name of the method.

    | Improve this Doc

    Parameters

    Gets the parameter of the method.

    Declaration
    public IEnumerable<ParameterSignature> Parameters { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<ParameterSignature>

    A sequence of type ParameterSignature containing information that matches the signature of the method.

    Methods

    | Improve this Doc

    Create(MethodBase)

    Creates and returns a MethodDescriptor object and automatically determines the type of the signature (be that method or property).

    Declaration
    public static MethodDescriptor Create(MethodBase method)
    Parameters
    Type Name Description
    System.Reflection.MethodBase method

    The method to extract a signature for.

    Returns
    Type Description
    MethodDescriptor

    A MethodDescriptor object.

    Remarks

    Although confusing a property is to be thought of as a method with either one or two methods (Get, Set) contained inside the property declaration.

    | Improve this Doc

    CreateMethod(Type, String)

    Creates and returns a MethodDescriptor object.

    Declaration
    public static MethodDescriptor CreateMethod(Type caller, string methodName)
    Parameters
    Type Name Description
    System.Type caller

    The class on which the methodName resides.

    System.String methodName

    The name of the method.

    Returns
    Type Description
    MethodDescriptor

    A MethodDescriptor object.

    | Improve this Doc

    CreateMethod(Type, String, ParameterSignature[])

    Creates and returns a MethodDescriptor object.

    Declaration
    public static MethodDescriptor CreateMethod(Type caller, string methodName, params ParameterSignature[] parameters)
    Parameters
    Type Name Description
    System.Type caller

    The class on which the methodName resides.

    System.String methodName

    The name of the method.

    ParameterSignature[] parameters

    A sequence of ParameterSignature that represent the parameter signature of the method.

    Returns
    Type Description
    MethodDescriptor

    A MethodDescriptor object.

    | Improve this Doc

    CreateProperty(Type, String)

    Creates and returns a MethodDescriptor object.

    Declaration
    public static MethodDescriptor CreateProperty(Type caller, string propertyName)
    Parameters
    Type Name Description
    System.Type caller

    The class on which the propertyName resides.

    System.String propertyName

    The name of the property.

    Returns
    Type Description
    MethodDescriptor

    A MethodDescriptor object with IsProperty initialized to true.

    Remarks

    Although confusing a property is to be thought of as a method with either one or two methods (Get, Set) contained inside the property declaration.

    | Improve this Doc

    CreateProperty(Type, String, ParameterSignature[])

    Creates and returns a MethodDescriptor object.

    Declaration
    public static MethodDescriptor CreateProperty(Type caller, string propertyName, params ParameterSignature[] parameters)
    Parameters
    Type Name Description
    System.Type caller

    The class on which the propertyName resides.

    System.String propertyName

    The name of the property.

    ParameterSignature[] parameters

    A sequence of ParameterSignature that represent the parameter signature of the method.

    Returns
    Type Description
    MethodDescriptor

    A MethodDescriptor object with IsProperty initialized to true.

    Remarks

    Although confusing a property is to be thought of as a method with either one or two methods (Get, Set) contained inside the property declaration.

    | Improve this Doc

    MergeParameters(MethodDescriptor, Object[])

    Merges the method parameter signature with the specified runtimeParameterValues.

    Declaration
    public static IDictionary<string, object> MergeParameters(MethodDescriptor method, params object[] runtimeParameterValues)
    Parameters
    Type Name Description
    MethodDescriptor method

    The method holding the parameter signature to merge with the runtime parameter values.

    System.Object[] runtimeParameterValues

    The runtime parameter values.

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

    An System.Collections.Generic.IDictionary<TKey, TValue> containing the merged result of the method parameter signature and runtimeParameterValues.

    | Improve this Doc

    MergeParameters(IEnumerable<ParameterSignature>, Object[])

    Merges the parameters signature with the specified runtimeParameterValues.

    Declaration
    public static IDictionary<string, object> MergeParameters(IEnumerable<ParameterSignature> parameters, params object[] runtimeParameterValues)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<ParameterSignature> parameters

    The parameter signature to merge with the runtime parameter values.

    System.Object[] runtimeParameterValues

    The runtime parameter values.

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

    An System.Collections.Generic.IDictionary<TKey, TValue> containing the merged result of the parameters signature and runtimeParameterValues.

    | Improve this Doc

    MergeParameters(Object[])

    Merges the Parameters signature of this instance with the specified runtimeParameterValues.

    Declaration
    public IDictionary<string, object> MergeParameters(params object[] runtimeParameterValues)
    Parameters
    Type Name Description
    System.Object[] runtimeParameterValues

    The runtime parameter values.

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

    An System.Collections.Generic.IDictionary<TKey, TValue> containing the merged result of the Parameters signature of this instance and runtimeParameterValues.

    | Improve this Doc

    ToString()

    Returns a System.String that represents the method signature.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A System.String that represents the method signature.

    Overrides
    System.Object.ToString()
    | Improve this Doc

    ToString(Boolean)

    Returns a System.String that represents the method signature.

    Declaration
    public string ToString(bool fullName)
    Parameters
    Type Name Description
    System.Boolean fullName

    Specify true to use the fully qualified name of the Caller; otherwise, false for the simple name.

    Returns
    Type Description
    System.String

    A System.String that represents the method signature.

    Remarks

    The returned string has the following format:
    Method without parameters: [Caller].MethodName
    Method with at least one or more parameter: [Caller].[MethodName]([ParameterType] [ParameterName])

    Property: [Caller].[MethodName]
    Property with at least one indexer: [Caller].[MethodName][[ParameterType] [ParameterName]]

    Extension Methods

    ConverterExtensions.ParseWith<TSource, TResult>(TSource, Func<TSource, TResult>)
    ConverterExtensions.ParseWith<TSource, T, TResult>(TSource, Func<TSource, T, TResult>, T)
    ConverterExtensions.ParseWith<TSource, T1, T2, TResult>(TSource, Func<TSource, T1, T2, TResult>, T1, T2)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, TResult>(TSource, Func<TSource, T1, T2, T3, TResult>, T1, T2, T3)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, TResult>(TSource, Func<TSource, T1, T2, T3, T4, TResult>, T1, T2, T3, T4)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, TResult>, T1, T2, T3, T4, T5, T6)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>, T1, T2, T3, T4, T5, T6, T7)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>, T1, T2, T3, T4, T5, T6, T7, T8)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
    ConverterExtensions.As<TResult>(Object)
    ConverterExtensions.As<TResult>(Object, TResult)
    ConverterExtensions.As<TResult>(Object, TResult, IFormatProvider)
    DelegateUtilityExtensions.Wrap<TResult>(TResult)
    DelegateUtilityExtensions.DynamicWrap<TResult>(TResult)
    TweakerExtensions.Adjust<T>(T, Func<T, T>)
    TypeUtilityExtensions.Is<T>(Object)
    TypeUtilityExtensions.IsNot<T>(Object)
    TypeUtilityExtensions.IsNullable<T>(T)
    WrapperExtensions.UseWrapper<T>(T, Action<IDictionary<String, Object>>)
    WrapperExtensions.UseWrapper<T>(T, MemberInfo, Action<IDictionary<String, Object>>)
    EnumerableUtilityExtensions.Yield<TSource>(TSource)
    HashUtilityExtensions.ComputeHash(Object, Action<HashOptions>)
    HmacUtilityExtensions.ComputeKeyedHash(Object, Byte[], Action<KeyedHashOptions>)
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX