private void EnsureControlServiceIsAlive() { try { if (_controlService.State == CommunicationState.Closed || _controlService.State == CommunicationState.Faulted) { _controlService.Abort(); _controlService = new PlayerControlServiceClient(new InstanceContext(this)); _controlService.Subscribe(); } } catch (Exception) { } }
private void SubscribeToControlEvents() { try { _controlService = new PlayerControlServiceClient(new InstanceContext(this)); _controlService.Subscribe(); } catch (Exception) { _controlService.Abort(); Thread thread = new Thread(() => { Thread.Sleep(5000); Initialize(); }); thread.IsBackground = true; thread.Start(); } }