Пример #1
0
        /// <summary>
        ///     Handles the message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Handle(GameResultAdded message)
        {
            if (message.GameResult.ArenaSessionId == null)
            {
                return;
            }

            var arena = arenaSessions.FirstOrDefault(x => x.Id == message.GameResult.ArenaSessionId);

            if (arena != null)
            {
                Execute.OnUIThread(
                    () =>
                {
                    using (PauseNotify.For(this))
                    {
                        var game = arena.Games.FirstOrDefault(x => x.Id == message.GameResult.Id);
                        if (game == null)
                        {
                            arena.Games.Insert(0, message.GameResult);
                            RefreshStats();
                        }
                        // arena.MapFrom(message.GameResult.ArenaSession);
                        SelectedGame = arena.Games.FirstOrDefault(x => x.Id == message.GameResult.Id);
                    }
                });
            }
        }
Пример #2
0
        /// <summary>
        ///     Handles the message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Handle(GameResultAdded message)
        {
            if (message.Source == this)
            {
                return;
            }

            LoadGameResult(message.GameResult);
        }