Esempio n. 1
0
 public void SetTrigger(Lazurite.MainDomain.TriggerBase trigger, Action callback = null)
 {
     StuckUILoadingWindow.Show(
         "Компоновка окна...",
         () =>
     {
         if (trigger != null)
         {
             _originalTrigger = trigger;
             _clonedTrigger   = (Lazurite.MainDomain.TriggerBase)Lazurite.Windows.Utils.Utils.CloneObject(_originalTrigger);
             _clonedTrigger.Initialize();
             buttonsView.SetTrigger(_clonedTrigger);
             IsModified                 = false;
             _constructorView           = new TriggerView(_clonedTrigger);
             _constructorView.Modified += () => Modified?.Invoke();
             _constructorView.Modified += () => buttonsView.TriggerModified();
             _constructorView.Modified += () => IsModified = true;
             _constructorView.Failed   += () => buttonsView.Failed();
             _constructorView.Succeed  += () => buttonsView.Success();
             contentPresenter.Content   = _constructorView;
             EmptyTriggerModeOff();
         }
         else
         {
             EmptyTriggerModeOn();
         }
         callback?.Invoke();
     }
         );
 }
Esempio n. 2
0
 private void ApplyInternal()
 {
     _originalTrigger.Stop();
     _repository.SaveTrigger(_clonedTrigger);
     _clonedTrigger.Initialize();
     _clonedTrigger.AfterInitialize();
     SetTrigger(
         _clonedTrigger,
         () => {
         Applied?.Invoke();
         IsModified = false;
     });
 }
Esempio n. 3
0
 public void Revert()
 {
     _clonedTrigger = (Lazurite.MainDomain.TriggerBase)Lazurite.Windows.Utils.Utils.CloneObject(_originalTrigger);
     try
     {
         _clonedTrigger.Initialize();
     }
     catch (Exception e)
     {
         _log.ErrorFormat(e, "Во время инициализации триггера {0} возникла ошибка.", _clonedTrigger.Name);
     }
     buttonsView.Revert(_clonedTrigger);
     _constructorView.Revert(_clonedTrigger);
     IsModified = false;
 }