Example #1
0
        /// <summary>
        /// Creates the action.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="methodInfo">The method info.</param>
        /// <returns></returns>
        protected virtual IAction CreateAction(IActionHost host, MethodInfo methodInfo)
        {
            var method   = _methodFactory.CreateFrom(methodInfo);
            var asyncAtt = method.GetMetadata <AsyncActionAttribute>();

            var filters = host.GetFilterManager(method);

            TryAddCanExecute(filters, method);

            if (asyncAtt == null)
            {
                return(new SynchronousAction(method, _messageBinder, filters));
            }
            return(new AsynchronousAction(method, _messageBinder, filters, asyncAtt.BlockInteraction));
        }
Example #2
0
        protected override IAction CreateAction(IActionHost host, MethodInfo methodInfo)
        {
            var method = _methodFactory.CreateFrom(methodInfo);
            var asyncAtt = method.GetMetadata<AsyncActionAttribute>();
            var backAtt = method.GetMetadata<BackgroundActionAttribute>();

            var filters = host.GetFilterManager(method);

            TryAddCanExecute(filters, method);

            if (asyncAtt != null)
                return new AsynchronousAction(method, _messageBinder, filters, asyncAtt.BlockInteraction);
            if (backAtt != null && backAtt.BackgroundEndMode != EndMode.Unspecified)
                return new BackgroundAction(method, _messageBinder, filters, backAtt.BlockInteraction);
            return new CustomSynchronousAction(method, _messageBinder, filters);
        }
Example #3
0
        protected override IAction CreateAction(IActionHost host, MethodInfo methodInfo)
        {
            var method   = _methodFactory.CreateFrom(methodInfo);
            var asyncAtt = method.GetMetadata <AsyncActionAttribute>();
            var backAtt  = method.GetMetadata <BackgroundActionAttribute>();

            var filters = host.GetFilterManager(method);

            TryAddCanExecute(filters, method);

            if (asyncAtt != null)
            {
                return(new AsynchronousAction(method, _messageBinder, filters, asyncAtt.BlockInteraction));
            }
            if (backAtt != null && backAtt.BackgroundEndMode != EndMode.Unspecified)
            {
                return(new BackgroundAction(method, _messageBinder, filters, backAtt.BlockInteraction));
            }
            return(new CustomSynchronousAction(method, _messageBinder, filters));
        }
Example #4
0
        /// <summary>
        /// Creates the action.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="methodInfo">The method info.</param>
        /// <returns></returns>
        protected virtual IAction CreateAction(IActionHost host, MethodInfo methodInfo)
        {
            var method = _methodFactory.CreateFrom(methodInfo);
            var asyncAtt = method.GetMetadata<AsyncActionAttribute>();

            var filters = host.GetFilterManager(method);

            TryAddCanExecute(filters, method);

            if(asyncAtt == null)
                return new SynchronousAction(method, _messageBinder, filters);
            return new AsynchronousAction(method, _messageBinder, filters, asyncAtt.BlockInteraction);
        }