コード例 #1
0
        private void LoadCardDecksInfo()
        {
            try
            {
                MemoryGameService.CardDeckRetrieverServiceClient cardDeckRetrieverServiceClient =
                new MemoryGameService.CardDeckRetrieverServiceClient();

                MemoryGameService.DataTransferObjects.CardDeckInfoDto[] cardDecksInfo =
                    cardDeckRetrieverServiceClient.GetCardDecksInfo();

                for (int index = 0; index < cardDecksInfo.Length; index++)
                {
                    _cardDecksInfoList.Add(cardDecksInfo[index]);
                }
                CardDeckComboBox.ItemsSource = _cardDecksInfoList;
                CardDeckComboBox.DisplayMemberPath = "CardDeckName";
                CardDeckComboBox.SelectedValuePath = "CardDeckId";
            }
            catch (EndpointNotFoundException)
            {
                MessageBox.Show(Properties.Langs.Resources.ServerConnectionLost);
            }
            catch (TimeoutException)
            {
                MessageBox.Show(Properties.Langs.Resources.ServerTimeoutError);
            }
            catch (CommunicationException)
            {
                MessageBox.Show(Properties.Langs.Resources.CommunicationInterrupted);
            }
        }
コード例 #2
0
 private void LoadCardDeck()
 {
     MemoryGameService.CardDeckRetrieverServiceClient cardDeckRetrieverServiceClient =
         new MemoryGameService.CardDeckRetrieverServiceClient();
     _cardDeck = cardDeckRetrieverServiceClient.GetCardDeckAndCards(_selectedCardDeckId);            
 }