示例#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");
                }
            });
        }
示例#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);
        }
示例#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;
            }
        }
示例#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");
                    }
                });
        }
示例#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;
        }