Пример #1
0
        public object InvokeEnd(object instance, out object[] outputs, IAsyncResult result)
        {
            if (OperationCache == null)
            {
                return(InnerOperationInvoker.InvokeEnd(instance, out outputs, result));
            }

            OperationCachingInvokerAsyncResult asyncResult = result as OperationCachingInvokerAsyncResult;

            if (asyncResult == null)
            {
                throw new ArgumentException("Invalid AsyncResult", "result");
            }
            OperationCachingInvokerAsyncResult.End(asyncResult);

            if (asyncResult.IsNewResult)
            {
                OperationCacheKey   key   = new OperationCacheKey(asyncResult.Action, asyncResult.Inputs);
                OperationCacheValue value = new OperationCacheValue(asyncResult.Outputs, asyncResult.ReturnValue);
                OperationCache.Insert(key, value);
            }

            outputs = asyncResult.Outputs;
            return(asyncResult.ReturnValue);
        }
Пример #2
0
 //- @InvokeEnd -//
 public Object InvokeEnd(Object instance, out Object[] outputs, IAsyncResult result)
 {
     return(InnerOperationInvoker.InvokeEnd(instance, out outputs, result));
 }