public void ResumeVideo() { try { if (_statusVideo == StatusVideoEnum.Lunched) { _service.Play(); ComPrortSender.Send(_currentVideo.FileMotion, Terminal, App.Current, App.SendMessage, App.SendException); _timerEnd.Start(); } else { ComPortPackagesService.Resume(); _timerEnd.Start(); _service.Play(); VideoBanner.StartPlayer(); } Observer.StartObserv(); _statusVideo = StatusVideoEnum.Started; } catch (Exception ex) { App.SendException(ex); MessageBox.Show($"Video not runned please wait. | {ex.Message}"); } }
private void startSend_Click(object sender, RoutedEventArgs e) { if (!flagIsStarted) { OpenFileDialog dialog = new OpenFileDialog(); if (dialog.ShowDialog() == true) { ComPrortSender.Send(dialog.FileName, Terminal, App.Current, App.SendMessage, App.SendException); } flagIsStarted = true; } }
public void StartGame() { if (_statusGame == StatusGameEnum.Lunched) { KeySimulationHelper.Simulation(_gameProcessor); ComPrortSender.Send(_currentGame.FileMotion, Terminal, App.Current, App.SendMessage, App.SendException); _timerEnd.Start(); if (_gameProcessor.Game.ShiftPressTime != null) { _timerShift.Start(); } _statusGame = StatusGameEnum.Started; } else { MessageBox.Show("Запустите сначала игру"); } }
public void StopGame() { try { if (_statusGame == StatusGameEnum.Started || _statusGame == StatusGameEnum.Lunched) { _gameProcessor.StopProcess(); ComPortPackagesService.Stop(); Thread.Sleep(250); ComPrortSender.StartMoutionPosition(); _gameProcessor.Dispose(); } else { MessageBox.Show("Игра не запущена"); } } catch (ObjectDisposedException e) { } }
public void StopVideo() { try { _timerEnd.Stop(); _videoProcessor.StopProcess(); if (_statusVideo == StatusVideoEnum.Started || _statusVideo == StatusVideoEnum.Pause) { ComPortPackagesService.Stop(); Thread.Sleep(250); ComPrortSender.StartMoutionPosition(); } _service.Stop(); _videoProcessor.Dispose(); _statusVideo = StatusVideoEnum.NotLunched; } catch (Exception ex) { } }