C# 클래스 NuGetConsole.Host.MethodBinder

A simple method binder to call interface methods.
파일 보기 프로젝트 열기: monoman/NugetCracker

공개 메소드들

메소드 설명
ConvertToType ( object arg ) : Type

Convert an arg to a Type.

Invoke ( MethodInfo method, object target, object args ) : object

Invoke a method.

IsType ( object arg ) : bool

Determines if an arg represents a Type. If true, ConvertToType will be called to get the Type. Used for generic methods.

보호된 메소드들

메소드 설명
ChangeType ( ParameterInfo parameterInfo, object arg ) : object

Helper method to Convert an arg to a parameter type. This method in turn calls System.Convert.ChangeType().

CreateResultTuple ( IList allResults ) : object

Create a tuple to return method call results. The results include the method return value and omitted [out] parameter values.

IsUnwrapArgsNeeded ( ParameterInfo parameterInfos ) : bool

Check if unwrap args is needed. If false, UnwrapArgs/WrapResult become NOP. The default implementation returns true if there is any [out] params.

TryReturnArg ( ParameterInfo parameterInfo, object arg, object argValue ) : bool

Try to rematch an arg with a parameter when returning from a method call. This is used to return values in [ref] args. This method is expected to do the same processing as TryConvertArg and return the same value. If a [ref] parameter is present, return the argValue in the arg.

비공개 메소드들

메소드 설명
TryConvertArg ( ParameterInfo parameterInfo, object arg, object &argValue ) : bool
TryGetOptionalArg ( ParameterInfo paramInfo, object &argValue ) : bool
TryInvoke ( Type type, string name, object target, object args, object &result ) : bool
UnwrapArgs ( MethodInfo m, object args ) : object[]
WrapResult ( MethodInfo m, object args, object result, object unwrappedArgs ) : object

메소드 상세

ChangeType() 보호된 정적인 메소드

Helper method to Convert an arg to a parameter type. This method in turn calls System.Convert.ChangeType().
protected static ChangeType ( ParameterInfo parameterInfo, object arg ) : object
parameterInfo System.Reflection.ParameterInfo The expected parameter info.
arg object The arg value.
리턴 object

ConvertToType() 공개 메소드

Convert an arg to a Type.
public ConvertToType ( object arg ) : Type
arg object An arg object.
리턴 System.Type

CreateResultTuple() 보호된 메소드

Create a tuple to return method call results. The results include the method return value and omitted [out] parameter values.
protected CreateResultTuple ( IList allResults ) : object
allResults IList The results list.
리턴 object

Invoke() 공개 메소드

Invoke a method.
public Invoke ( MethodInfo method, object target, object args ) : object
method System.Reflection.MethodInfo The method info.
target object The target object to invoke the method.
args object Arguments for the method call.
리턴 object

IsType() 공개 메소드

Determines if an arg represents a Type. If true, ConvertToType will be called to get the Type. Used for generic methods.
public IsType ( object arg ) : bool
arg object An arg object.
리턴 bool

IsUnwrapArgsNeeded() 보호된 메소드

Check if unwrap args is needed. If false, UnwrapArgs/WrapResult become NOP. The default implementation returns true if there is any [out] params.
protected IsUnwrapArgsNeeded ( ParameterInfo parameterInfos ) : bool
parameterInfos System.Reflection.ParameterInfo All the parameterinfo.
리턴 bool

TryReturnArg() 보호된 추상적인 메소드

Try to rematch an arg with a parameter when returning from a method call. This is used to return values in [ref] args. This method is expected to do the same processing as TryConvertArg and return the same value. If a [ref] parameter is present, return the argValue in the arg.
protected abstract TryReturnArg ( ParameterInfo parameterInfo, object arg, object argValue ) : bool
parameterInfo System.Reflection.ParameterInfo The current expected parameter info.
arg object A passed in arg.
argValue object The arg value after the method call.
리턴 bool