private bool TryStoppingInteraction(DiagramInteractionEventArguments interaction, DiagramInteractor activeInteractor) { var didInteractionStop = activeInteractor.ShouldStopInteraction(interaction); if (didInteractionStop) { ActiveDiagramInteractors.Remove(activeInteractor); ActiveDiagramInteractorNames.Remove(activeInteractor.GetType().Name); activeInteractor.StopInteraction(interaction); } return(didInteractionStop); }
private void StartAndProcessInteractionsThatShouldStart(DiagramInteractionEventArguments interaction) { foreach (var interactor in WeightedDiagramInteractors) { if (interactor.ShouldStartInteraction(interaction)) { interactor.StartInteraction(interaction); ActiveDiagramInteractors.Add(interactor); ActiveDiagramInteractorNames.Add(interactor.GetType().Name); interactor.ProcessInteraction(interaction); if (!TryStoppingInteraction(interaction, interactor)) { break; } } } }