Exemplo n.º 1
0
        private static IWampRpcOperation CreateProgressiveOperation(object instance, MethodInfo method, string procedureUri)
        {
            //return new ProgressiveAsyncMethodInfoRpcOperation<returnType>
            // (instance, method, procedureUri);

            Type returnType =
                TaskExtensions.UnwrapReturnType(method.ReturnType);

            Type operationType =
                typeof(ProgressiveAsyncMethodInfoRpcOperation <>)
                .MakeGenericType(returnType);

            IWampRpcOperation operation =
                (IWampRpcOperation)Activator.CreateInstance(operationType,
                                                            instance,
                                                            method,
                                                            procedureUri);

            return(operation);
        }