Пример #1
0
        /// <summary>
        /// Creates an <see cref="IAction"/> using the specified context.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>The <see cref="IAction"/>.</returns>
        public IAction Create(ActionCreationContext context)
        {
            var method = context.MethodFactory
                .CreateFrom(context.Method);

            var action = new AsynchronousAction(
                context.ServiceLocator,
                method,
                context.MessageBinder,
                context.CreateFilterManager(method),
                BlockInteraction
                );

            context.ConventionManager
                .ApplyActionCreationConventions(action, method);

            return action;
        }
Пример #2
0
        /// <summary>
        /// Creates an <see cref="IAction"/> using the specified context.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>The <see cref="IAction"/>.</returns>
        public IAction Create(ActionCreationContext context)
        {
            var method = context.MethodFactory
                         .CreateFrom(context.Method);

            var action = new SynchronousAction(
                context.ServiceLocator,
                method,
                context.MessageBinder,
                context.CreateFilterManager(method),
                BlockInteraction
                );

            context.ConventionManager
            .ApplyActionCreationConventions(action, method);

            return(action);
        }
Пример #3
0
 /// <summary>
 /// Creates the filter manager for the method based on the context.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="method">The method.</param>
 /// <returns></returns>
 public static IFilterManager CreateFilterManager(this ActionCreationContext context, IMethod method)
 {
     return(new FilterManager(context.TargetType, method.Info, context.ServiceLocator).Combine(context.TargetFilters));
 }