I use DynamicObject to wrap internal objects and masks, but when I try to call certain methods on an internal object, they require typed parameters, however, I consider all parameters as an Object type so that the call does not execute.
code:
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result) { try { result = mInternalObject.GetType().InvokeMember(binder.Name, (BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public), null, mInternalObject, args); return true; } catch (Exception) { return base.TryInvokeMember(binder, args, out result); } }
So basically, I am wondering how to make it ignore the paramater types and call the method with the object anyway, any sugestions?
source share