Exemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            BaseScore = 1000;
            //Add Input Time
            string time = TimerTextBox.Text;

            OrigTime = (int)System.TimeSpan.Parse(time).TotalSeconds;
            BaseScoreTextBlock.Text = BaseScore.ToString();
            TimerTextBox.IsReadOnly = true;

            for (int i = 0; i < 3; i++)
            {
                var list = new List <PuzzlePiece>();
                for (int j = 0; j < 3; j++)
                {
                    var image = new PuzzlePiece();
                    list.Add(image);
                }
                scrambledList.Add(list);
            }
            scrambledList[2][2] = null;
            leftBorder          = canvasLeftPadding;
            rightBorder         = container.Width + canvasLeftPadding;
            topBorder           = canvasTopPadding + TitleBar.Height;
            bottomBorder        = container.Height + canvasTopPadding;

            //Key Arrows
            this.KeyDown += new KeyEventHandler(KeyDownHandler);
        }
Exemplo n.º 2
0
        public override void LoadScore(BaseScore baseScore, ScoreCenter center)
        {
            FussballdeScore fsc = baseScore as FussballdeScore;

            m_center    = center;
            m_iconIndex = 0;

            errorProvider1.Clear();

            tbxScoreId.Text    = fsc.Id;
            tbxName.Text       = fsc.Name;
            tbxUrl.Text        = fsc.Url;
            tbxDetails.Text    = fsc.Details;
            tbxLevels.Text     = fsc.Levels;
            tbxHighlights.Text = fsc.Highlights;

            if (!String.IsNullOrEmpty(fsc.Image))
            {
                string iconPath = Path.Combine(Config.GetSubFolder(Config.Dir.Thumbs, "ScoreCenter"), fsc.Image + ".png");
                if (File.Exists(iconPath))
                {
                    pictureBox1.Image = new Bitmap(iconPath);
                }
                else
                {
                    pictureBox1.Image = Properties.Resources.fussballde_logo;
                }
            }
            else
            {
                pictureBox1.Image = Properties.Resources.fussballde_logo;
            }
        }
Exemplo n.º 3
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;
            }
        }
Exemplo n.º 4
0
        public override bool SaveScore(ref BaseScore baseScore)
        {
            if (!CheckData())
            {
                return(false);
            }

            GenericScore score = baseScore as GenericScore;

            score.Name       = tbxScore.Text;
            score.Url        = tbxUrl.Text;
            score.XPath      = tbxXpath.Text;
            score.XPathRow   = tbxXPathRow.Text;
            score.XPathCol   = tbxXPathCol.Text;
            score.Headers    = tbxHeaders.Text;
            score.Sizes      = tbxSizes.Text;
            score.Encoding   = tbxEncoding.Text;
            score.Element    = tbxElement.Text.Trim();
            score.Dictionary = tbxDictionary.Text.Trim();

            score.SetParseOption(ckxUseCaption.Checked, ckxUseTheader.Checked,
                                 ckxNewLine.Checked, ckxAllowWrapping.Checked, ckxReverseOrder.Checked, ckxImgAlt.Checked);
            score.BetweenElts = (BetweenElements)Enum.Parse(typeof(BetweenElements), cbxBetweenElements.SelectedValue.ToString());

            if (tbxSkip.Text.Length == 0)
            {
                score.Skip = 0;
            }
            else
            {
                score.Skip = int.Parse(tbxSkip.Text);
            }

            if (tbxMaxLines.Text.Length == 0)
            {
                score.MaxLines = 0;
            }
            else
            {
                score.MaxLines = int.Parse(tbxMaxLines.Text);
            }

            if (!ckxLive.Checked && tbxLiveFormat.Text.Length == 0 && tbxLiveFilter.Text.Length == 0)
            {
                score.LiveConfig = null;
            }
            else
            {
                score.LiveConfig         = new LiveConfig();
                score.LiveConfig.enabled = ckxLive.Checked;
                score.LiveConfig.Value   = tbxLiveFormat.Text;
                score.LiveConfig.filter  = Tools.TrimList(tbxLiveFilter.Text);
                tbxLiveFilter.Text       = score.LiveConfig.filter;
            }

            SaveRules(score);
            return(true);
        }
Exemplo n.º 5
0
        public override bool SaveScore(ref BaseScore baseScore)
        {
            if (!CheckData())
            {
                return(false);
            }

            baseScore.Name = tbxScore.Text;
            return(true);
        }
Exemplo n.º 6
0
        public string ToVectorString()
        {
            var builder = new StringBuilder();

            builder.Append("(");
            builder.Append(BaseScore.ToVectorString(true));
            builder.Append("/");
            builder.Append(EnvironmentalScore.ToVectorString(true));
            builder.Append("/");
            builder.Append(TemporalScore.ToVectorString(true));
            builder.Append(")");

            return(builder.ToString());
        }
Exemplo n.º 7
0
        public override bool SaveScore(ref BaseScore baseScore)
        {
            if (!CheckData())
            {
                return(false);
            }

            RssScore score = baseScore as RssScore;

            score.Name     = tbxScore.Text;
            score.Url      = tbxUrl.Text;
            score.Encoding = tbxEncoding.Text;

            return(true);
        }
Exemplo n.º 8
0
        public override void LoadScore(BaseScore baseScore, ScoreCenter center)
        {
            m_center = center;
            RssScore score = baseScore as RssScore;

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

            tbxScoreId.Text  = score.Id;
            tbxScore.Text    = score.Name;
            tbxUrl.Text      = score.Url;
            tbxEncoding.Text = score.Encoding;
        }
Exemplo n.º 9
0
        public override bool SaveScore(ref BaseScore baseScore)
        {
            if (!CheckData())
            {
                return(false);
            }

            FussballdeScore score = baseScore as FussballdeScore;

            score.Name       = tbxName.Text;
            score.Url        = tbxUrl.Text;
            score.Details    = tbxDetails.Text;
            score.Levels     = tbxLevels.Text;
            score.Highlights = tbxHighlights.Text;
            return(true);
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
0
        public override void LoadScore(BaseScore baseScore, ScoreCenter center)
        {
            m_center = center;
            UpdateStyleList();

            GenericScore score = baseScore as GenericScore;

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

            errorProvider1.Clear();

            // always clear
            tbxScore.Clear();
            tbxUrl.Clear();
            tbxXpath.Clear();
            tbxXPathRow.Clear();
            tbxXPathCol.Clear();
            tbxEncoding.Clear();
            tbxHeaders.Clear();
            tbxSizes.Clear();
            tbxSkip.Clear();
            tbxMaxLines.Clear();
            tbxElement.Clear();
            ckxUseTheader.Checked    = false;
            ckxUseCaption.Checked    = false;
            ckxImgAlt.Checked        = false;
            ckxNewLine.Checked       = false;
            ckxAllowWrapping.Checked = false;
            ckxLive.Checked          = false;
            tbxLiveFormat.Clear();
            tbxLiveFilter.Clear();
            tbxDictionary.Clear();

            grdRule.Rows.Clear();
            grdRule.Enabled = false;

            // score
            EnableControls();
            tbxLiveFormat.Enabled = false;
            tbxLiveFilter.Enabled = false;

            ParsingOptions options = score.GetParseOption();

            tbxScore.Text = score.Name;

            tbxUrl.Text        = score.Url;
            tbxXpath.Text      = score.XPath;
            tbxXPathRow.Text   = score.XPathRow;
            tbxXPathCol.Text   = score.XPathCol;
            tbxEncoding.Text   = score.Encoding;
            tbxHeaders.Text    = score.Headers;
            tbxSizes.Text      = score.Sizes;
            tbxSkip.Text       = score.Skip.ToString();
            tbxMaxLines.Text   = score.MaxLines.ToString();
            tbxElement.Text    = score.Element;
            tbxDictionary.Text = score.Dictionary;

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

            ckxUseTheader.Checked            = Tools.CheckParsingOption(options, ParsingOptions.UseTheader);
            ckxUseCaption.Checked            = Tools.CheckParsingOption(options, ParsingOptions.Caption);
            ckxNewLine.Checked               = Tools.CheckParsingOption(options, ParsingOptions.NewLine);
            ckxAllowWrapping.Checked         = Tools.CheckParsingOption(options, ParsingOptions.WordWrap);
            ckxReverseOrder.Checked          = Tools.CheckParsingOption(options, ParsingOptions.Reverse);
            ckxImgAlt.Checked                = Tools.CheckParsingOption(options, ParsingOptions.ImgAlt);
            cbxBetweenElements.SelectedValue = score.BetweenElts;
            tbxScoreId.Text = score.Id;

            grdRule.Enabled = true;
            SetRules(score, center);
        }
Exemplo n.º 12
0
 private void Start()
 {
     baseScore = FindObjectOfType <BaseScore>();
     baseScore.SetHealth(health);
 }
Exemplo n.º 13
0
 public virtual bool SaveScore(ref BaseScore baseScore)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 14
0
 public virtual void LoadScore(BaseScore baseScore, ScoreCenter center)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 15
0
 public string[][] Read(BaseScore score, bool reload, ScoreParameter[] parameters)
 {
     return(Parse(score as T, reload, parameters));
 }
Exemplo n.º 16
0
 public override void LoadScore(BaseScore baseScore, ScoreCenter center)
 {
     tbxScore.Text   = baseScore.Name;
     tbxScoreId.Text = baseScore.Id;
 }