public static AwaitableStateConfiguration <TState, TTrigger> PermitIf <TState, TTrigger>(
            this AwaitableStateConfiguration <TState, TTrigger> config, Func <Task <bool> > predicate, TTrigger trigger,
            TState resultingState, Action onTriggerAction)
        {
            Contract.NotNull(onTriggerAction != null, nameof(onTriggerAction));

            return(config.PermitIf(predicate, trigger, resultingState, t => onTriggerAction()));
        }
コード例 #2
0
        public static AwaitableStateConfiguration <TState, TTrigger> PermitIf <TState, TTrigger>(
            this AwaitableStateConfiguration <TState, TTrigger> config, Func <bool> predicate, TTrigger trigger,
            TState resultingState, Action onTriggerAction)
        {
            Contract.Requires <ArgumentNullException>(onTriggerAction != null, nameof(onTriggerAction));

            return(config.PermitIf(predicate, trigger, resultingState, t => onTriggerAction()));
        }
        public static AwaitableStateConfiguration <TState, TTrigger> PermitIf <TArgument, TState, TTrigger>(
            this AwaitableStateConfiguration <TState, TTrigger> config, Func <bool> predicate,
            ParameterizedTrigger <TTrigger, TArgument> trigger,
            TState resultingState, Action <TArgument> onTriggerAction)
        {
            Contract.NotNull(onTriggerAction != null, nameof(onTriggerAction));

            return(config.PermitIf(predicate, trigger, resultingState, (t, a) => onTriggerAction(a)));
        }