Exemplo n.º 1
0
        private void frmSplash_Load(object sender, EventArgs e)
        {
            clsitem itm = null;

            System.Xml.XmlNode     tit = null;
            System.Xml.XmlNodeList nl = null;
            System.Xml.XmlDocument doc = new System.Xml.XmlDocument(), inf = new System.Xml.XmlDocument();
            doc.Load(Application.StartupPath + "\\Data\\Game.xml");
            nl = doc.SelectNodes("/xml/Game");
            foreach (System.Xml.XmlNode n in nl)
            {
                itm      = new clsitem();
                tit      = n.SelectSingleNode("title");
                itm.Name = tit.InnerText;
                tit      = n.SelectSingleNode("data");
                if (tit != null)
                {
                    itm.Value = tit.InnerText;
                    inf.Load(Application.StartupPath + tit.InnerText);
                    tit         = inf.SelectSingleNode("/xml/Game/title");
                    itm.Version = tit.Attributes.GetNamedItem("version").Value;
                    itm.Img     = Application.StartupPath + tit.Attributes.GetNamedItem("splash").Value;
                    itm.Author  = inf.SelectSingleNode("/xml/Game/author").InnerText;
                }
                cboGames.Items.Add(itm);
            }
            doc = null;
        }
Exemplo n.º 2
0
        private void cboGames_SelectedIndexChanged(object sender, EventArgs e)
        {
            clsitem itm = (clsitem)cboGames.SelectedItem;

            if (itm.Img != null && itm.Img != string.Empty)
            {
                Image img = System.Drawing.Image.FromFile(itm.Img);
                this.BackgroundImage = img;
            }
            if (itm.Author != string.Empty)
            {
                lblAuthor.Text    = "Author: " + itm.Author;
                lblAuthor.Visible = true;
            }
            if (itm.Version != string.Empty)
            {
                lblVersion.Text    = "Version: " + itm.Version;
                lblVersion.Visible = true;
            }
        }
Exemplo n.º 3
0
        private void SetupGPMasterMind()
        {
            CheckBox chk = null;
            clsitem  itm = null;

            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
            System.Xml.XmlNodeList nl  = null;
            bool enabled = true;

            this.Expansions = new System.Collections.ArrayList();
            gpReset();
            foreach (Control c in grpBx1.Controls)
            {
                chk = (CheckBox)c;
                if (chk.Checked)
                {
                    itm = new clsitem(chk.Text, (string)chk.Tag);
                    Expansions.Add(itm);
                    doc.Load(Application.StartupPath + itm.Value);
                    nl = doc.SelectNodes("/xml/Cards/set/masterminds/card");
                    Label lbl = new Label();
                    lbl.Text     = itm.Name + ":";
                    lbl.Location = new Point(4, 12);
                    lbl.AutoSize = true;
                    grpBx2.Controls.Add(lbl);
                    foreach (System.Xml.XmlNode n in nl)
                    {
                        addChk(n.Attributes["name"].Value, enabled, n.Attributes["group"].Value, grpBx2);
                    }
                }
            }
            grpBx1.Visible = false;
            grpBx2.Visible = true;
            this.Text      = "Choose Mastermind";
            doc            = null;
        }