Пример #1
0
        public void AsignarDireccionEntrega(Direccion nuevaDireccion)
        {
            if (!IsInProgress)
            {
                throw new InvalidOperationException();
            }

            if (DireccionEntrega == nuevaDireccion)
            {
                return;
            }

            DireccionEntrega = nuevaDireccion;

            _stateMachine.Fire(Trigger.AsignarDireccionEntrega);
        }
Пример #2
0
 /// <summary>
 /// Erstellt den Handler für die Zahlenbuttons. Dabei wird die gedrückte Zahl (als
 /// CommandParameter in XAML) zum PIN dazugezählt.
 /// </summary>
 /// <returns></returns>
 private ICommand CreatePinNumberCommand()
 {
     return(new RelayCommand(
                (param) =>
     {
         if (param == null)
         {
             return;
         }
         Pin = Pin * 10 + int.Parse(param.ToString());
         if (Pin >= 1000)
         {
             stateMachine.Fire(Triggers.LastPinNumberEntered);
         }
     },
                (param) => stateMachine.CanFire(Triggers.LastPinNumberEntered)
                ));
 }
            void TrackState(object sender, PropertyChangedEventArgs e)
            {
                if (machine.PermittedTriggers.Contains(e.PropertyName))
                {
#if DEBUG
                    VsOutputLogger.WriteLine(String.Format(CultureInfo.InvariantCulture, "{3} {0} title:{1} busy:{2}", e.PropertyName, ((ITeamExplorerSection)sender).Title, ((ITeamExplorerSection)sender).IsBusy, DateTime.Now));
#endif
                    machine.Fire(e.PropertyName);
                }
            }
Пример #4
0
 void TrackState(object sender, PropertyChangedEventArgs e)
 {
     if (machine.PermittedTriggers.Contains(e.PropertyName))
     {
         log.Debug("{PropertyName} title:{Title} busy:{IsBusy}",
                   e.PropertyName,
                   ((ITeamExplorerSection)sender).Title,
                   ((ITeamExplorerSection)sender).IsBusy);
         machine.Fire(e.PropertyName);
     }
 }
Пример #5
0
 public void Fire(TTrigger trigger)
 {
     _stateMachine.Fire(trigger);
 }
 public void Up()
 {
     _machine.Fire(LampTrigger.Up);
 }