C# Class System.Dynamic.Utils.TypeExtensions

Show file Open project: dotnet/corefx

Public Methods

Method Description
GetAnyStaticMethodValidated ( this type, string name, Type types ) : MethodInfo

Returns the matching method if the parameter types are reference assignable from the provided type arguments, otherwise null.

GetReturnType ( this mi ) : Type
GetTypeCode ( this type ) : TypeCode

Private Methods

Method Description
GetParametersCached ( this method ) : System.Reflection.ParameterInfo[]
IsByRefParameter ( this pi ) : bool
MatchesArgumentTypes ( this mi, Type argTypes ) : bool

Returns true if the method's parameter types are reference assignable from the argument types, otherwise false. An example that can make the method return false is that typeof(double).GetMethod("op_Equality", ..., new[] { typeof(double), typeof(int) }) returns a method with two double parameters, which doesn't match the provided argument types.

Method Details

GetAnyStaticMethodValidated() public static method

Returns the matching method if the parameter types are reference assignable from the provided type arguments, otherwise null.
public static GetAnyStaticMethodValidated ( this type, string name, Type types ) : MethodInfo
type this
name string
types Type
return System.Reflection.MethodInfo

GetReturnType() public static method

public static GetReturnType ( this mi ) : Type
mi this
return Type

GetTypeCode() public static method

public static GetTypeCode ( this type ) : TypeCode
type this
return TypeCode