private void ChangeStatusEventTriggered(ChangeStatusEvent obj) { OnShowLoader(); var thread = new Thread(() => { if (_orderRepository.ChangeOrderStatus(_orderCollection.FirstOrDefault().LaborDetailId, obj.StatusId, TaskClient.UrlData.DatabaseKey.ToString(), out _errorMessage)) { _eventAggregator.GetEvent <PubSubEvent <DetailEvent> >().Publish(new DetailEvent(DetailState.Hide)); } else { (_parentView as DispatcherObject).Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show(_errorMessage, "Не вдалося змінити статус наряду!", MessageBoxButton.OK, MessageBoxImage.Warning); })); } OnHideLoader(); }); thread.IsBackground = true; thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
public async Task Handle(ChangeStatusEvent cmd) { if (cmd.NewStatus == CheckProfilePorcess.ReviewDoneState.Name && cmd.ProfileType == KycProfile.LykkeEurope) { await _firstCheckService.PerformFirstCheckAsync(cmd.ClientId); } }
public static DataChangeEvent Serdes(DataChangeEvent e, AssetMapping mapping, ISerializer s) { if (s == null) { throw new ArgumentNullException(nameof(s)); } if (s.IsWriting() && e == null) { throw new ArgumentNullException(nameof(e)); } ChangeProperty property = s.EnumU8(nameof(ChangeProperty), e?.ChangeProperty ?? ChangeProperty.Unk0); return(property switch { ChangeProperty.Unk0 => ChangeUnk0Event.Serdes((ChangeUnk0Event)e, s), ChangeProperty.Health => ChangeHealthEvent.Serdes((ChangeHealthEvent)e, mapping, s), ChangeProperty.Mana => ChangeManaEvent.Serdes((ChangeManaEvent)e, mapping, s), ChangeProperty.Status => ChangeStatusEvent.Serdes((ChangeStatusEvent)e, mapping, s), ChangeProperty.Language => ChangeLanguageEvent.Serdes((ChangeLanguageEvent)e, mapping, s), ChangeProperty.Experience => ChangeExperienceEvent.Serdes((ChangeExperienceEvent)e, mapping, s), ChangeProperty.UnkB => ChangeUnkBEvent.Serdes((ChangeUnkBEvent)e, s), ChangeProperty.UnkC => ChangeUnkCEvent.Serdes((ChangeUnkCEvent)e, s), ChangeProperty.Item => ChangeItemEvent.Serdes((ChangeItemEvent)e, mapping, s), ChangeProperty.Gold => ChangeGoldEvent.Serdes((ChangeGoldEvent)e, mapping, s), ChangeProperty.Food => ChangeFoodEvent.Serdes((ChangeFoodEvent)e, mapping, s), _ => throw new FormatException($"Unexpected data change type \"{property}\"") });
private void Tick_tick(Object obj) { this.Time--; ChangeStatusEvent?.Invoke(this, new CentrifugeStatusChangeEventArg() { Code = this.Code, StatusEnum = this.StatusEnum, Time = this.Time }); if (this.Time <= 0) { this.RunTimer.Change(Timeout.Infinite, Timeout.Infinite); Console.WriteLine("停止计时"); TimerSemaphore.Release(1); } }
public static ChangeStatusEvent Serdes(ChangeStatusEvent e, AssetMapping mapping, ISerializer s) { if (s == null) { throw new ArgumentNullException(nameof(s)); } e ??= new ChangeStatusEvent(); e.Operation = s.EnumU8(nameof(Operation), e.Operation); e.Unk3 = s.UInt8(nameof(Unk3), e.Unk3); int zeroed = s.UInt8(null, 0); e.PartyMemberId = PartyMemberId.SerdesU8(nameof(PartyMemberId), e.PartyMemberId, mapping, s); e.Status = s.EnumU16(nameof(Status), e.Status); e.Amount = s.UInt16(nameof(Amount), e.Amount); s.Assert(zeroed == 0, "ChangeStatusEvent: Expected byte 4 to be 0"); return(e); }
/// <summary> /// Добавление нового исключения в стек системы ошибок /// </summary> /// <param name="exception">Исключение</param> public void ExecuteException(NirsException exception) { _nirsErrors.Add(new NirsError(exception.NameSource, exception.NameSystem, exception.Message, DateTime.Now, true)); ChangeStatusEvent?.Invoke(exception.Message, exception.NameSystem); }
/// <summary> /// Выполнение команды /// </summary> /// <param name="param"></param> public void Execute(object param) { execute(param); ChangeStatusEvent?.Invoke(); }
//Изменение операции private void OperationEventExecuter() => ChangeStatusEvent?.Invoke();