private void WindowLoaded(object sender, RoutedEventArgs e) { _matchServiceClient = new MemoryGameService.MatchServiceClient(Context); try { LoadUsernamesToBeVoted(); } catch (EndpointNotFoundException) { MessageBox.Show(Properties.Langs.Resources.ServerConnectionLost); } catch (TimeoutException) { MessageBox.Show(Properties.Langs.Resources.ServerTimeoutError); } catch (CommunicationException) { MessageBox.Show(Properties.Langs.Resources.CommunicationInterrupted); } }
private void LeaveGameButtonClicked(object sender, RoutedEventArgs e) { try { MemoryGameService.MatchServiceClient matchServiceClient = new MemoryGameService.MatchServiceClient(Context); matchServiceClient.LeaveMatch(MatchHost, PlayerUsername); } catch (EndpointNotFoundException) { MessageBox.Show(Properties.Langs.Resources.ServerConnectionLost); } catch (TimeoutException) { MessageBox.Show(Properties.Langs.Resources.ServerTimeoutError); } catch (CommunicationException) { MessageBox.Show(Properties.Langs.Resources.CommunicationInterrupted); } finally { this.Close(); } }