Version 3.3.0.1

MemberAliasMethodInfo class

Namespace: Sirenix.Utilities
Assembly: Sirenix.Utilities
public sealed class MemberAliasMethodInfo : MethodInfo, ICustomAttributeProvider, _MemberInfo, _MethodBase, _MethodInfo
Provides a methods of representing aliased methods.

In this case, what we're representing is a method on a parent class with the same name.

We aggregate the MethodInfo associated with this member and return a mangled form of the name. The name that we return is "parentname+methodName".

Inheritance
  • System.Object
  • System.Reflection.MemberInfo
  • System.Reflection.MethodBase
  • System.Reflection.MethodInfo
  • MemberAliasMethodInfo
See Also
  • System.Reflection.FieldInfo

Constructors

MemberAliasMethodInfo(MethodInfo, String)
Initializes a new instance of the MemberAliasMethodInfo class.
public MemberAliasMethodInfo(MethodInfo method, string namePrefix)
Parameters
System.Reflection.MethodInfo method

The method to alias.

System.String namePrefix

The name prefix to use.

MemberAliasMethodInfo(MethodInfo, String, String)
Initializes a new instance of the MemberAliasMethodInfo class.
public MemberAliasMethodInfo(MethodInfo method, string namePrefix, string separatorString)
Parameters
System.Reflection.MethodInfo method

The method to alias.

System.String namePrefix

The name prefix to use.

System.String separatorString

The separator string to use.

Properties

AliasedMethod
Gets the aliased method.
public MethodInfo AliasedMethod { get; }
Attributes
Gets the attributes associated with this method.
public override MethodAttributes Attributes { get; }
DeclaringType
Gets the class that declares this member.
public override Type DeclaringType { get; }
MethodHandle
Gets a handle to the internal metadata representation of a method.
public override RuntimeMethodHandle MethodHandle { get; }
Name
Gets the name of the current member.
public override string Name { get; }
ReflectedType
Gets the class object that was used to obtain this instance of MemberInfo.
public override Type ReflectedType { get; }
ReturnType
public override Type ReturnType { get; }
ReturnTypeCustomAttributes
Gets the custom attributes for the return type.
public override ICustomAttributeProvider ReturnTypeCustomAttributes { get; }

Methods

GetBaseDefinition()
When overridden in a derived class, returns the MethodInfo object for the method on the direct or indirect base class in which the method represented by this instance was first declared.
public override MethodInfo GetBaseDefinition()
Returns
System.Reflection.MethodInfo

A MethodInfo object for the first implementation of this method.

GetCustomAttributes(Boolean)
When overridden in a derived class, returns an array of all custom attributes applied to this member.
public override object[] GetCustomAttributes(bool inherit)
Parameters
System.Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns
System.Object[]

An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.

GetCustomAttributes(Type, Boolean)
When overridden in a derived class, returns an array of custom attributes applied to this member and identified by System.Type.
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
System.Type attributeType

The type of attribute to search for. Only attributes that are assignable to this type are returned.

System.Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns
System.Object[]

An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to attributeType have been applied.

GetMethodImplementationFlags()
When overridden in a derived class, returns the System.Reflection.MethodImplAttributes flags.
public override MethodImplAttributes GetMethodImplementationFlags()
Returns
System.Reflection.MethodImplAttributes

The MethodImplAttributes flags.

GetParameters()
When overridden in a derived class, gets the parameters of the specified method or constructor.
public override ParameterInfo[] GetParameters()
Returns
System.Reflection.ParameterInfo[]

An array of type ParameterInfo containing information that matches the signature of the method (or constructor) reflected by this MethodBase instance.

Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
When overridden in a derived class, invokes the reflected method or constructor with the given parameters.
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
Parameters
System.Object obj

The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor.

System.Reflection.BindingFlags invokeAttr

A bitmask that is a combination of 0 or more bit flags from System.Reflection.BindingFlags. If binder is null, this parameter is assigned the value System.Reflection.BindingFlags.Default; thus, whatever you pass in is ignored.

System.Reflection.Binder binder

An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null, the default binder is used.

System.Object[] parameters

An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, this should be null.If the method or constructor represented by this instance takes a ByRef parameter, there is no special attribute required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type.

System.Globalization.CultureInfo culture

An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.)

Returns
System.Object

An Object containing the return value of the invoked method, or null in the case of a constructor, or null if the method's return type is void. Before calling the method or constructor, Invoke checks to see if the user has access permission and verifies that the parameters are valid.CautionElements of the parameters array that represent parameters declared with the ref or out keyword may also be modified.

IsDefined(Type, Boolean)
When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member.
public override bool IsDefined(Type attributeType, bool inherit)
Parameters
System.Type attributeType

The type of custom attribute to search for. The search includes derived types.

System.Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns
System.Boolean

true if one or more instances of attributeType or any of its derived types is applied to this member; otherwise, false.

Extension Methods