예제 #1
0
 private void EditBtn_Click(object sender, EventArgs e)
 {
     if (this.SelectedSkill != null)
     {
         int skillData = this.fChallenge.Skills.IndexOf(this.SelectedSkill);
         SkillChallengeSkillForm skillChallengeSkillForm = new SkillChallengeSkillForm(this.SelectedSkill);
         if (skillChallengeSkillForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             this.fChallenge.Skills[skillData] = skillChallengeSkillForm.SkillData;
             this.fChallenge.Skills.Sort();
             this.update_view();
             this.update_skills();
         }
     }
 }
예제 #2
0
        private void add_skill(string skill_name)
        {
            SkillChallengeSkillForm skillChallengeSkillForm = new SkillChallengeSkillForm(new SkillChallengeData()
            {
                SkillName = skill_name
            });

            if (skillChallengeSkillForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.fChallenge.Skills.Add(skillChallengeSkillForm.SkillData);
                this.fChallenge.Skills.Sort();
                this.update_view();
                this.update_skills();
            }
        }
        void add_skill(string skill_name)
        {
            SkillChallengeData scd = new SkillChallengeData();

            scd.SkillName = skill_name;

            SkillChallengeSkillForm dlg = new SkillChallengeSkillForm(scd);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                fChallenge.Skills.Add(dlg.SkillData);
                fChallenge.Skills.Sort();

                update_view();
                update_skills();
            }
        }
        private void EditBtn_Click(object sender, EventArgs e)
        {
            if (SelectedSkill != null)
            {
                int index = fChallenge.Skills.IndexOf(SelectedSkill);

                SkillChallengeSkillForm dlg = new SkillChallengeSkillForm(SelectedSkill);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    fChallenge.Skills[index] = dlg.SkillData;
                    fChallenge.Skills.Sort();

                    update_view();
                    update_skills();
                }
            }
        }