Exemplo n.º 1
0
 public static Action Action(object owner, IFlowChangeable changeable, Action action)
 {
     return(new FlowAction(owner, () => {
         // Capture to ensure lifetime
         var d1 = changeable;
         action();
     }, changeable));
 }
Exemplo n.º 2
0
 public static Action Action(object owner, IFlowChangeable changeable1, IFlowChangeable changeable2, IFlowChangeable changeable3, Action action)
 {
     return(new FlowAction(owner, () => {
         // Capture to ensure lifetime
         var d1 = changeable1;
         var d2 = changeable2;
         var d3 = changeable3;
         action();
     }, changeable1, changeable2, changeable3));
 }
Exemplo n.º 3
0
 public static Action Action(object owner, IFlowChangeable changeable1, IFlowChangeable changeable2, IFlowChangeable changeable3, IFlowChangeable changeable4, IFlowChangeable changeable5, IFlowChangeable changeable6, Action action)
 {
     return(new FlowAction(owner, () => {
         // Capture to ensure lifetime
         var d1 = changeable1;
         var d2 = changeable2;
         var d3 = changeable3;
         var d4 = changeable4;
         var d5 = changeable5;
         var d6 = changeable6;
         action();
     }, changeable1, changeable2, changeable3, changeable4, changeable5, changeable6));
 }
Exemplo n.º 4
0
        private void UpdateTracking(IFlowChangeable node, int i)
        {
            lock (_lock) {
                _subscriptions[i]?.Dispose();

                if (i == _transitions.Length)
                {
                    _target           = (TClass)node;
                    _subscriptions[i] = DisposableSubscribeToTarget(_target);
                    return;
                }

                _subscriptions[i] = node.AddDisposableSubscription(this, () => {
                    UpdateTracking(_transitions[i](node), i + 1);
                    OnChange();
                });

                UpdateTracking(_transitions[i](node), i + 1);
            }
        }
Exemplo n.º 5
0
 public static Action Action(this IFlowChangeable changeable, object owner, Action action)
 {
     return(Flow.Action(owner, changeable, action));
 }