コード例 #1
0
        public override byte[] InvokeImpl(ImportFunctionUtil utils)
        {
            if (this.function == null)
            {
                throw new System.Exception("Invoked host function not defined.");
            }

            List <object> fnParams = utils.GetParamsAsObjects();
            List <object> retObjs  = function.Invoke(fnParams);

            return(utils.ConvertObjectsToResult(retObjs));
        }
コード例 #2
0
        public override byte[] InvokeImpl(ImportFunctionUtil utils)
        {
            if (this.fnTyVali == null)
            {
                this.ValidateFunction_FirstUse(utils.functionType);
            }
            else if (this.fnTyVali != utils.functionType)
            {
                throw new System.Exception("Attempting to use reflected function instance for multiple types. No allowed.");
            }

            List <object> lstParams = utils.GetParamsAsObjects();
            object        ret       = this.function.Invoke(this.invokingObject, lstParams.ToArray());

            if (ret == null)
            {
                return(null);
            }

            return(utils.ConvertObjectsToResult(new List <object> {
                ret
            }));                                                          // This could no-doubt be optimized by making a non-list version
        }