Version 3.3.0.1

MethodInfoExtensions class

Namespace: Sirenix.Utilities
Assembly: Sirenix.Utilities
public static class MethodInfoExtensions
Various extensions for MethodInfo.
Inheritance
  • System.Object
  • MethodInfoExtensions

Methods

DeAliasMethod(MethodInfo, Boolean)
Returns the original, backing method of an alias method if the method is an alias.
public static MethodInfo DeAliasMethod(this MethodInfo methodInfo, bool throwOnNotAliased = false)
Parameters
System.Reflection.MethodInfo methodInfo

The method to check.

System.Boolean throwOnNotAliased

if set to true an exception will be thrown if the method is not aliased.

Returns
System.Reflection.MethodInfo

Exceptions
System.ArgumentException

The method was not aliased; this only occurs if throwOnNotAliased is true.

GetFullName(MethodBase)
Returns the specified method's full name.
public static string GetFullName(this MethodBase method)
Parameters
System.Reflection.MethodBase method

Returns
System.String

GetFullName(MethodBase, String)
Returns the specified method's full name "methodName(argType1 arg1, argType2 arg2, etc)" Uses the specified gauntlet to replaces type names, ex: "int" instead of "Int32"
public static string GetFullName(this MethodBase method, string extensionMethodPrefix)
Parameters
System.Reflection.MethodBase method

System.String extensionMethodPrefix

Returns
System.String

GetParamsNames(MethodBase)
Returns a string representing the passed method parameters names. Ex "int num, float damage, Transform target"
public static string GetParamsNames(this MethodBase method)
Parameters
System.Reflection.MethodBase method

Returns
System.String

IsAliasMethod(MethodInfo)
Determines whether the specified method is an alias.
public static bool IsAliasMethod(this MethodInfo methodInfo)
Parameters
System.Reflection.MethodInfo methodInfo

The method to check.

Returns
System.Boolean

true if the specified method is an alias; otherwise, false.

IsExtensionMethod(MethodBase)
Tests if a method is an extension method.
public static bool IsExtensionMethod(this MethodBase method)
Parameters
System.Reflection.MethodBase method

Returns
System.Boolean