示例#1
0
        /// <summary>
        /// Initializes the WvW teams collection
        /// </summary>
        private void InitializeWorlds()
        {
            lock (objectivesRefreshTimerLock)
            {
                logger.Debug("Initializing worlds");

                Threading.InvokeOnUI(() => this.Worlds.Clear());

                var matchIDs   = this.wvwService.GetMatchIDs();
                var teamColors = this.wvwService.GetTeamColors();

                foreach (var world in this.wvwService.Worlds)
                {
                    var team = new WvWTeamViewModel(world);
                    if (matchIDs.ContainsKey(team.WorldId))
                    {
                        team.MatchId = matchIDs[team.WorldId];
                    }
                    if (teamColors.ContainsKey(team.WorldId))
                    {
                        team.Color = teamColors[team.WorldId];
                    }
                    Threading.InvokeOnUI(() => this.Worlds.Add(team));
                }
            }
        }
示例#2
0
        /// <summary>
        /// Initializes the WvW teams collection
        /// </summary>
        private void InitializeWorlds()
        {
            lock (objectivesRefreshTimerLock)
            {
                logger.Debug("Initializing worlds");

                Threading.InvokeOnUI(() => this.Worlds.Clear());

                var matchIDs   = this.wvwService.GetMatchIDs();
                var teamColors = this.wvwService.GetTeamColors();

                foreach (var world in this.wvwService.Worlds)
                {
                    var team = new WvWTeamViewModel(world);
                    if (matchIDs.ContainsKey(team.WorldId))
                    {
                        team.MatchId = matchIDs[team.WorldId];
                    }
                    if (teamColors.ContainsKey(team.WorldId))
                    {
                        team.Color = teamColors[team.WorldId];
                    }
                    Threading.InvokeOnUI(() => this.Worlds.Add(team));
                }

                // Launch a task to refresh world score
                // Do this with a background task so we don't slow down initialization (this is not critical)
                Task.Factory.StartNew(this.RefreshWorldScores);
            }
        }