Core/CafeLib.Core.Dynamic/Expando.cs
/// <summary>
/// Reflection helper method to invoke a method
/// </summary>
/// <param name="name"></param>
/// <param name="args"></param>
/// <param name="result"></param>
/// <returns></returns>
Reflection helper method to invoke a method
Reflection helper method to invoke a method
protected bool InvokeMethod(string name, object[] args, out object result)
        {
            var miArray = _instanceType.GetMember(name,
                                    BindingFlags.InvokeMethod |
                                    BindingFlags.Public | BindingFlags.Instance);
            if (miArray.Length > 0)
            {
                var mi = miArray[0] as MethodInfo;
                result = mi?.Invoke(_instance, args);
                return true;
            }
            result = null;
            return false;
        }
protected bool InvokeMethod ( string name , object [ ] args , out object result ) { var miArray = _instanceType . GetMember ( name , BindingFlags . InvokeMethod | BindingFlags . Public | BindingFlags . Instance ) ; if ( miArray . Length > 0 ) { var mi = miArray [ 0 ] as MethodInfo ; result = mi ? . Invoke ( _instance , args ) ; return true ; } result = null ; return false ; }
Reflection helper method to invoke a method
Reflection helper method to invoke a method
// Look at the instanceType
None
name
string
None
args
object[]
None
object
out
result
None