コード例 #1
0
        private void Continue()
        {
            frmArcheryWorx tmpAW = (frmArcheryWorx)this.MdiParent;

            tmpAW.SetArcher(Selected(listBoxArchers));
            this.Close();
        }
コード例 #2
0
        /// <summary>
        /// Checks to see if the archer is properly configured
        /// </summary>
        /// <returns>True if all is good.</returns>
        private bool CheckArcher()
        {
            frmArcheryWorx tmpArchery = (frmArcheryWorx)this.MdiParent;

            MyArcher = tmpArchery.GetArcher();
            string path = Directory.GetCurrentDirectory().ToString() + "\\Archers\\" + MyArcher + ".xml";

            cArcher tmpArcher = new cArcher();

            //MessageBox.Show(path);
            if (path != "")
            {
                tmpArcher = tmpArcher.GetArcher(path);
                try
                {
                    MyDrawDistance = Convert.ToDouble(tmpArcher.DrawLength);
                    MyDrawWeight   = Convert.ToDouble(tmpArcher.DrawWeight);
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
            return(false);
        }
コード例 #3
0
        private void CheckArcher()
        {
            frmArcheryWorx tmpArchery = (frmArcheryWorx)this.MdiParent;
            string         MyArcher   = tmpArchery.GetArcher();
            string         path       = Directory.GetCurrentDirectory().ToString() + "\\Archers\\" + MyArcher + ".xml";

            cArcher tmpArcher = new cArcher();

            //MessageBox.Show(path);
            if (path != "")
            {
                tmpArcher          = tmpArcher.GetArcher(path);
                lblName.Text       = tmpArcher.Name;
                lblDrawLength.Text = tmpArcher.DrawLength;
                lblDrawWeight.Text = tmpArcher.DrawWeight;
                lblDoB.Text        = tmpArcher.DoB;
                lblGender.Text     = tmpArcher.Gender;
                lblHandiness.Text  = tmpArcher.Handiness;
            }
        }
コード例 #4
0
        private void BowSearch_Load(object sender, EventArgs e)
        {
            List <string> tmpList = new List <string>();

            cCompoundBowTools cBowTools = new cCompoundBowTools();

            tmpList = cBowTools.GetBows();
            //--------------------------------------------------------------------------------------------------------------------------------------------------
            for (int i = 0; i < tmpList.Count; i++)
            {
                listBoxSysBows.Items.Add(tmpList[i]);
            }
            //--------------------------------------------------------------------------------------------------------------------------------------------------

            listBoxSysBows.Items.Clear();
            for (int i = 0; i < tmpList.Count; i++)
            {
                listBoxSysBows.Items.Add(tmpList[i]);
            }

            lblCount.Text = tmpList.Count.ToString() + " Bows";

            frmArcheryWorx tmpArchery = (frmArcheryWorx)this.MdiParent;

            MyArcher = tmpArchery.GetArcher();
            string path = Directory.GetCurrentDirectory().ToString() + "\\Archers\\" + MyArcher + ".xml";

            cArcher tmpArcher = new cArcher();

            //MessageBox.Show(path);
            if (path != "")
            {
                tmpArcher      = tmpArcher.GetArcher(path);
                MyDrawDistance = Convert.ToDouble(tmpArcher.DrawLength);
                MyDrawWeight   = Convert.ToDouble(tmpArcher.DrawWeight);
            }
            txtUsrDrawLength.Text = MyDrawDistance.ToString();
            txtUsrDrawWeight.Text = MyDrawWeight.ToString();
        }