Пример #1
0
        /// <summary>
        /// Subscribe to the state change of the node.
        /// </summary>
        /// <param name="successor">The node to subscribe the state changes.</param>
        protected virtual void SubscribeStateChanged(Node successor)
        {
            this.StateChanged += (s, e) => successor.ComposeState(StateChangeSource.Predecessor);
            successor.ComposeState(StateChangeSource.Predecessor);

            successor.StateChanged += (s, e) => this.ComposeState(StateChangeSource.Successor);
            this.ComposeState(StateChangeSource.Successor);
        }
Пример #2
0
 /// <summary>
 /// Subscribe to state changes of this node.
 /// </summary>
 protected override void SubscribeStateChanged(Node successor)
 {
     // No need to subscribe to state changes of the initial node
 }