// Call only from Steps! public void RegisterStep(Step step) { step.StateChanged += HandleStepStateChanged; step.SeekToRequested += HandleStepSeekToRequested; step.SeekThroughRequested += HandleStepSeekThroughRequested; if (!step.IsJustMovingNotBeingDeleted) { var boundsProvider = step as IBoundsProvider; if (boundsProvider != null) { BoundsProviderRepository.Add(boundsProvider); } } RegisteredSteps.Add(step); }
// Call only from Steps! public void UnregisterStep(Step step) { step.StateChanged -= HandleStepStateChanged; step.SeekToRequested -= HandleStepSeekToRequested; step.SeekThroughRequested -= HandleStepSeekThroughRequested; RegisteredSteps.Remove(step); if (!step.IsJustMovingNotBeingDeleted) { var boundsProvider = step as IBoundsProvider; if (boundsProvider != null) { BoundsProviderRepository.Remove(boundsProvider); } } step.CleanUp(); StepUnregistered(step); }