예제 #1
0
        public object Invoke(int MethodId, params object[] args)
        {
            if (IsDisposed)
            {
                throw new Exception("The shared class is disposed");
            }

            SharedMethod method = GetMethod(MethodId);

            lock (method.InvokeLocky)
            {
                ReturnResult ret = method.Invoke(args) as ReturnResult;

                if (ret != null)
                {
                    if (ret.ExceptionOccured)
                    {
                        throw new Exception(ret.exceptionMessage);
                    }
                    return(ret.ReturnValue);
                }
                return(null);
            }
            throw new Exception("Method not found");
        }
예제 #2
0
        public object Invoke(params object[] args)
        {
            if (sharedMethod.sharedClass.IsDisposed)
            {
                throw new Exception("The shared class is disposed");
            }

            ReturnResult ret = sharedMethod.Invoke(args) as ReturnResult;

            if (ret != null)
            {
                if (ret.ExceptionOccured)
                {
                    throw new Exception(ret.exceptionMessage);
                }
                return(ret.ReturnValue);
            }
            return(null);
        }
예제 #3
0
        public object Invoke(string MethodName, params object[] args)
        {
            SharedMethod method = null;

            if ((method = GetMethod(MethodName, args)) != null)
            {
                lock (method.InvokeLocky)
                {
                    ReturnResult ret = method.Invoke(args) as ReturnResult;

                    if (ret != null)
                    {
                        if (ret.ExceptionOccured)
                        {
                            throw new Exception(ret.exceptionMessage);
                        }
                        return(ret.ReturnValue);
                    }
                    return(null);
                }
            }
            throw new Exception("Method not found");
        }
예제 #4
0
 public object Invoke(params object[] args)
 {
     return(sharedMethod.Invoke(args));
 }