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) { } }