Exemplo n.º 1
0
 public void AddEntryAction(Func <Transition, object[], Task> action, Reflection.InvocationInfo entryActionDescription)
 {
     EntryActions.Add(
         new EntryActionBehavior.Async(
             action,
             entryActionDescription));
 }
Exemplo n.º 2
0
 public void AddExitAction(Func <Transition, Task> action, Reflection.InvocationInfo exitActionDescription)
 {
     ExitActions.Add(new ExitActionBehavior.Async(action, exitActionDescription));
 }
Exemplo n.º 3
0
 public void AddActivateAction(Func <Task> action, Reflection.InvocationInfo activateActionDescription)
 {
     ActivateActions.Add(new ActivateActionBehaviour.Async(_state, action, activateActionDescription));
 }
Exemplo n.º 4
0
            public void AddEntryAction(TTrigger trigger, Func <Transition, object[], Task> action, Reflection.InvocationInfo entryActionDescription)
            {
                if (action == null)
                {
                    throw new ArgumentNullException(nameof(action));
                }

                EntryActions.Add(
                    new EntryActionBehavior.Async((t, args) =>
                {
                    if (t.Trigger.Equals(trigger))
                    {
                        return(action(t, args));
                    }

                    return(TaskResult.Done);
                },
                                                  entryActionDescription));
            }
Exemplo n.º 5
0
 public Sync(TState state, Action action, Reflection.InvocationInfo actionDescription)
     : base(state, actionDescription)
 {
     _action = action;
 }
Exemplo n.º 6
0
 public void AddEntryAction(Action <Transition, object[]> action, Reflection.InvocationInfo entryActionDescription)
 {
     _entryActions.Add(new EntryActionBehavior.Sync(action, entryActionDescription));
 }
Exemplo n.º 7
0
 protected EntryActionBehavior(Reflection.InvocationInfo description)
 {
     _description = description;
 }
Exemplo n.º 8
0
 public void AddExitAction(Action <Transition> action, Reflection.InvocationInfo exitActionDescription)
 {
     ExitActions.Add(new ExitActionBehavior.Sync(action, exitActionDescription));
 }
 public Sync(Action <Transition> action, Reflection.InvocationInfo actionDescription) : base(actionDescription)
 {
     _action = action;
 }
Exemplo n.º 10
0
 public Async(Func <Transition, Task> action, Reflection.InvocationInfo actionDescription) : base(actionDescription)
 {
     _action = action;
 }
Exemplo n.º 11
0
 protected ExitActionBehavior(Reflection.InvocationInfo actionDescription)
 {
     Description = actionDescription ?? throw new ArgumentNullException(nameof(actionDescription));
 }
Exemplo n.º 12
0
 internal GuardCondition(Func <object[], bool> guard, Reflection.InvocationInfo description)
 {
     Guard = guard ?? throw new ArgumentNullException(nameof(guard));
     _methodDescription = description ?? throw new ArgumentNullException(nameof(description));
 }
Exemplo n.º 13
0
 /// <summary>
 /// Constructor that takes in a guard with no argument.
 /// This is needed because we wrap the no-arg guard with a lamba and therefore method description won't match what was origianlly passed in.
 /// We need to preserve the method description before wrapping so Reflection methods will work.
 /// </summary>
 /// <param name="guard">No Argument Guard Condition</param>
 /// <param name="description"></param>
 internal GuardCondition(Func <bool> guard, Reflection.InvocationInfo description)
     : this(args => guard(), description)
 {
 }
Exemplo n.º 14
0
 public void AddDeactivateAction(Action action, Reflection.InvocationInfo deactivateActionDescription)
 {
     DeactivateActions.Add(new DeactivateActionBehaviour.Sync(_state, action, deactivateActionDescription));
 }
Exemplo n.º 15
0
 public Sync(Action <Transition, object[]> action, Reflection.InvocationInfo description) : base(description)
 {
     _action = action;
 }
Exemplo n.º 16
0
 public void AddEntryAction(TTrigger trigger, Action <Transition, object[]> action, Reflection.InvocationInfo entryActionDescription)
 {
     EntryActions.Add(new EntryActionBehavior.SyncFrom <TTrigger>(trigger, action, entryActionDescription));
 }
Exemplo n.º 17
0
 public SyncFrom(TTriggerType trigger, Action <Transition, object[]> action, Reflection.InvocationInfo description)
     : base(action, description)
 {
     Trigger = trigger;
 }
Exemplo n.º 18
0
 protected DeactivateActionBehaviour(TState state, Reflection.InvocationInfo actionDescription)
 {
     _state             = state;
     _actionDescription = actionDescription ?? throw new ArgumentNullException(nameof(actionDescription));
 }
Exemplo n.º 19
0
 public Async(Func <Transition, object[], Task> action, Reflection.InvocationInfo description) : base(description)
 {
     _action = action;
 }
Exemplo n.º 20
0
 public Async(TState state, Func <Task> action, Reflection.InvocationInfo actionDescription)
     : base(state, actionDescription)
 {
     _action = action;
 }
Exemplo n.º 21
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ActionInfo(InvocationInfo method, string fromTrigger)
 {
     Method      = method;
     FromTrigger = fromTrigger;
 }