private object InvokeWorker(params object[] args) { if (_target.IsStatic) { try { return(_target.Invoke(null, args)); } catch (TargetInvocationException e) { throw ExceptionHelpers.UpdateForRethrow(e.InnerException); } } try { return(_target.Invoke(args[0], GetNonStaticArgs(args))); } catch (TargetInvocationException e) { throw ExceptionHelpers.UpdateForRethrow(e.InnerException); } }
public override object InvokeInstance(object instance, params object[] args) { if (_target.IsStatic) { try { return(_target.Invoke(null, args)); } catch (TargetInvocationException e) { throw ExceptionHelpers.UpdateForRethrow(e.InnerException); } } try { return(_target.Invoke(instance, args)); } catch (TargetInvocationException e) { throw ExceptionHelpers.UpdateForRethrow(e.InnerException); } }