private void btnLoad_Click(object sender, EventArgs e) { OpenFileDialog bleh = new OpenFileDialog(); string path = Directory.GetCurrentDirectory().ToString() + "\\Archers\\";//".";//"./Archers"; bleh.InitialDirectory = path; bleh.ShowDialog(); cArcher tmpArcher = new cArcher(); if (bleh.FileName != "") { tmpArcher = tmpArcher.GetArcher(bleh.FileName); //MessageBox.Show(tmpArcher.Name + " is a " + tmpArcher.Gender + " who is " + tmpArcher.Handiness + " who was born " + tmpArcher.DoB); //tmpArcher = tmpArcher.GetArcher(path); comboBoxBows.Text = tmpArcher.CompoundBow; txtUsrName.Text = tmpArcher.Name; txtUsrDrawLength.Text = tmpArcher.DrawLength; txtUsrDrawWeight.Text = tmpArcher.DrawWeight; dateTimePickerUsrAge.Text = tmpArcher.DoB; comboBoxUsrGender.Text = tmpArcher.Gender; comboBoxHandiness.Text = tmpArcher.Handiness; txtUsrHeight.Text = tmpArcher.Height; txtUsrWeight.Text = tmpArcher.Weight; } }
/// <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); }
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; } }
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(); }