Myslik.Utils.ParsedScript.CallMethod C# (CSharp) Method

CallMethod() public method

Calls a method.
public CallMethod ( string methodName ) : object
methodName string The method name. May not be null.
return object
        public object CallMethod(string methodName, params object[] arguments)
        {
            if (_dispatch == null)
                throw new InvalidOperationException();

            if (methodName == null)
                throw new ArgumentNullException("methodName");

            try
            {
                return _dispatch.GetType().InvokeMember(methodName, BindingFlags.InvokeMethod, null, _dispatch, arguments);
            }
            catch
            {
                if (_engine._site._lastException != null)
                    throw _engine._site._lastException;

                throw;
            }
        }