Westwind.WebConnection.wwDotNetBridge.InvokeMethod_Internal C# (CSharp) Method

InvokeMethod_Internal() private method

private InvokeMethod_Internal ( object instance, string method ) : object
instance object
method string
return object
        internal object InvokeMethod_Internal(object instance, string method, params object[] args)
        {
            SetError();

            object[] ar;
            if (args == null || args.Length == 0)
                ar = new object[0];
            else
            {
                ar = new object[args.Length];
                for (int i = 0; i < args.Length; i++)
                {
                    ar[i] = FixupParameter(args[i]);
                }
            }

            object result = null;
            try
            {
                if(method.Contains(".") || method.Contains("["))
                    result = ReflectionUtils.CallMethodEx(instance, method, ar);
                else
                    result = ReflectionUtils.CallMethodCom(instance, method, ar);
            }
            catch (Exception ex)
            {
                SetError(ex.GetBaseException(), true);
                throw ex.GetBaseException();
            }

            // Update ComValue parameters to support ByRef Parameters
            for (int i = 0; i < ar.Length; i++)
            {
                if (args[i] is ComValue)
                    ((ComValue) args[i]).Value = FixupReturnValue(ar[i]);
            }

            return FixupReturnValue(result);
        }
wwDotNetBridge