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

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

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

            return(config.PermitReentryIf(predicate, trigger, t => onTriggerAction()));
        }