Example #1
0
        public override void LoadScore(BaseScore baseScore, ScoreCenter center)
        {
            m_center = center;
            WorldFootballScore score = baseScore as WorldFootballScore;

            if (score == null)
            {
                throw new NullReferenceException("Not a WorldFootballScore score!");
            }

            errorProvider1.Clear();

            // always clear
            tbxName.Clear();
            tbxCountry.Clear();
            tbxLeague.Clear();
            tbxSeason.Clear();
            tbxLevels.Clear();
            tbxHighlights.Clear();
            tbxDetails.Clear();
            ckxLiveEnabled.Checked = false;
            tbxLiveFilter.Clear();

            tbxName.Text          = score.Name;
            tbxCountry.Text       = score.Country;
            tbxLeague.Text        = score.League;
            tbxSeason.Text        = score.Season;
            numNbTeams.Value      = score.NbTeams;
            numRounds.Value       = score.Rounds;
            tbxLevels.Text        = score.Levels;
            cbxKind.SelectedValue = score.Kind;
            tbxHighlights.Text    = score.Highlights;
            tbxDetails.Text       = score.Details;
            tbxScoreId.Text       = score.Id;
            ckxTwoGames.Checked   = score.TwoLegs;

            if (score.LiveConfig != null)
            {
                ckxLiveEnabled.Checked = score.LiveConfig.enabled;
                tbxLiveFilter.Text     = score.LiveConfig.filter;
            }

            if (!String.IsNullOrEmpty(score.Image))
            {
                string iconPath = Path.Combine(Config.GetSubFolder(Config.Dir.Thumbs, "ScoreCenter"), score.Image + ".png");
                if (File.Exists(iconPath))
                {
                    pictureBox1.Image = new Bitmap(iconPath);
                }
                else
                {
                    pictureBox1.Image = Properties.Resources.wfb_logo;
                }
            }
            else
            {
                pictureBox1.Image = Properties.Resources.wfb_logo;
            }
        }
Example #2
0
        public override bool SaveScore(ref BaseScore baseScore)
        {
            if (!CheckData())
            {
                return(false);
            }

            WorldFootballScore score = baseScore as WorldFootballScore;

            score.Name       = tbxName.Text;
            score.Country    = tbxCountry.Text;
            score.League     = tbxLeague.Text;
            score.Season     = tbxSeason.Text;
            score.NbTeams    = (int)numNbTeams.Value;
            score.Rounds     = (int)numRounds.Value;
            score.Levels     = tbxLevels.Text;
            score.Highlights = Tools.TrimList(tbxHighlights.Text);
            score.Details    = Tools.TrimList(tbxDetails.Text);
            tbxDetails.Text  = score.Details;
            score.Kind       = (WorldFootballKind)Enum.Parse(typeof(WorldFootballKind), cbxKind.SelectedValue.ToString());
            score.TwoLegs    = ckxTwoGames.Checked;

            if (ckxLiveEnabled.Checked && tbxLiveFilter.Text.Length > 0)
            {
                score.LiveConfig         = new LiveConfig();
                score.LiveConfig.enabled = true;
                score.LiveConfig.filter  = Tools.TrimList(tbxLiveFilter.Text);
                tbxLiveFilter.Text       = score.LiveConfig.filter;
            }
            else
            {
                score.LiveConfig = null;
            }

            if (String.IsNullOrEmpty(score.Image))
            {
                score.Image = String.Format("Football\\{0}", GetFullName());
            }

            return(true);
        }
 public ScoreDetails(WorldFootballScore wfscore, ScoreParameter[] parameters)
 {
     m_score      = wfscore;
     m_parameters = parameters;
 }