Exemple #1
0
        public Item_DST(NFLTeam dst)
        {
            this.model       = dst;
            this.displayName = DataConverter.ConvertToCode(this.model.TeamCode);

            Messenger.Default.Register <MarkedPlayerChanged>(this,
                                                             (m) =>
            {
                if (m.Name == this.displayName)
                {
                    this.RaisePropertyChanged("IsHighlighted");
                }
            });
        }
Exemple #2
0
        /// <summary />
        public NFLTeam GetTeam(string code)
        {
            code = code.Trim();

            NFLTeam team;

            bool exists = this.teamCache.TryGetValue(code, out team);

            if (!exists)
            {
                // create the team and update the cache
                team = new NFLTeam(code);
                this.teamCache.Add(code, team);
            }

            return(team);
        }
Exemple #3
0
        private void AssignTeam(NFLPlayer player, XElement element)
        {
            // if the player has played for multiple teams, we
            // only want the most recent team that they have
            // played for.
            var    fields   = element.Elements().ToList();
            string teamcode = fields[1].Value;

            NFLTeam team = this.context.GetTeam(teamcode);

            if (player.Team != team)
            {
                // if team has changed, we will update -- we only need to track the most recent
                // team.  This is all that matters.
                player.Team = team;
            }
        }
Exemple #4
0
        public Item_DST(NFLTeam dst)
        {
            this.model = dst;
            this.displayName = DataConverter.ConvertToCode(this.model.TeamCode);

            Messenger.Default.Register<MarkedPlayerChanged>(this,
                (m) =>
                {
                    if (m.Name == this.displayName)
                    {
                        this.RaisePropertyChanged("IsHighlighted");
                    }
                });
        }
Exemple #5
0
        /// <summary />
        public NFLTeam GetTeam(string code)
        {
            code = code.TrimStart('@');
            code = code.TrimStart('v', 's');
            code = code.TrimStart();
            code = code.TrimEnd();

            NFLTeam team;

            bool exists = this.teamCache.TryGetValue(code, out team);
            if (!exists)
            {
                // create the team and update the cache
                team = new NFLTeam(code);
                this.teamCache.Add(code, team);
            }

            return team;
        }