Exemplo n.º 1
0
        public void AddToUI(Step currentStep, IModifier currentModifier)
        {
            currentStep_     = currentStep;
            currentModifier_ = currentModifier;

            if (currentStep_ == null)
            {
                return;
            }

            if (currentModifier_ != null)
            {
                if (modifierMonitor_ == null ||
                    modifierMonitor_.ModifierType != currentModifier.GetFactoryTypeName())
                {
                    modifierMonitor_ = CreateModifierMonitor(currentModifier);
                }
            }

            if (currentStep_?.Duration != null)
            {
                if (duration_ == null ||
                    duration_.DurationType != currentStep_.Duration.GetFactoryTypeName())
                {
                    duration_ = CreateDurationMonitor(
                        "Duration", currentStep_.Duration);
                }
            }

            widgets_.AddToUI(runningStep_);
            widgets_.AddToUI(active_);
            widgets_.AddToUI(enabled_);
            widgets_.AddToUI(paused_);
            widgets_.AddToUI(forceCheckEnabled_);
            widgets_.AddToUI(forceRun_);

            if (duration_ != null)
            {
                duration_.AddToUI(currentStep_.Duration);
            }

            foreach (var w in repeat_.GetWidgets())
            {
                widgets_.AddToUI(w);
            }

            foreach (var w in delay_.GetWidgets(currentStep_?.Delay))
            {
                widgets_.AddToUI(w);
            }

            foreach (var w in overlap_.GetWidgets())
            {
                widgets_.AddToUI(w);
            }

            if (modifierMonitor_ != null)
            {
                modifierMonitor_.AddToUI(currentModifier);
            }
        }