public ToolbarManager(IControl control, ToolbarPanel parent) { if (parent == null) { throw new ArgumentNullException(nameof(parent)); } grip = new Grip(); ToolbarPanel.SetDockDirection(grip, ToolbarPanel.DockDirection.None); grip.PointerPressed += ClickArea_PointerPressed; grip.PointerReleased += ClickArea_PointerReleased; grip.PointerMoved += ClickArea_PointerMoved; this.GetObservable(ToolbarEndProperty).Subscribe((_) => { parent?.InvalidateArrange(); }); Transitions = new Transitions(); Transitions.AddRange(positionTransitions); this.parent = parent; childToolbar = control; parent.Children.Add(grip); }
/// <summary> /// State constructor. /// </summary> /// <param name="entering">Entering state action. Called before the state is entered.</param> /// <param name="within">Within state action. Called when the state is updated.</param> /// <param name="exiting">Exiting state action. Called when the state is exited.</param> /// <param name="transitions">State transition collection. Transitions from this state to (possible) others are kept here.</param> public State(Action entering = null, Action within = null, Action exiting = null, IEnumerable <Transition> transitions = null) { Entering = entering; Within = within; Exiting = exiting; if (transitions != null) { Transitions.AddRange(transitions); } }
/// <summary> /// Adds another PetriNet to this at the given Transition (since the other PetriNet should start with a place). /// Keep in mind to close all open sinks afterwards! /// </summary> /// <param name="petriNet">The other PetriNet</param> /// <param name="atTransition">A transition in THIS PetriNet, where the added net will be connected</param> /// <author>Jannik Arndt</author> public void MergeWithPetriNet(PetriNet petriNet, Transition atTransition) { List <Node> sources = petriNet.GetSources(); if (sources.Count > 0) { atTransition.OutgoingPlaces.Add((sources[0] as Place)); atTransition.OutgoingPlaces[0].AppendIncomingTransition(atTransition); Transitions.AddRange(petriNet.Transitions); Places.AddRange(petriNet.Places); } }