/// <summary>
        /// Handles the message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Handle(DeckUpdated message)
        {
            if (message.Deck == null)
            {
                this.RefreshDecks();
                return;
            }

            var found = this.Decks.FirstOrDefault(x => x.Id == message.Deck.Id);

            if (found != null)
            {
                found.MapFrom(message.Deck);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Handle(DeckUpdated message)
        {
            if (message.Deck == null)
            {
                this.RefreshDecks();
                return;
            }

            var found = this.Decks.FirstOrDefault(x => x.Id == message.Deck.Id);

            if (found != null)
            {
                found.MapFrom(message.Deck);
            }

            foreach (var gameResult in this.gameResults)
            {
                if (gameResult.Deck != null && gameResult.Deck.Id == message.Deck.Id)
                {
                    gameResult.Deck = message.Deck;
                }
            }
        }