Exemplo n.º 1
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            GoalForm goalForm = new GoalForm(new Goal("New Goal"));

            if (goalForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                List <Goal> prerequisites = (this.SelectedGoal != null ? this.SelectedGoal.Prerequisites : this.fPartyGoals.Goals);
                if (prerequisites == this.fPartyGoals.Goals && this.fPartyGoals.Goals.Count != 0)
                {
                    prerequisites = this.fPartyGoals.Goals[0].Prerequisites;
                }
                prerequisites.Add(goalForm.Goal);
                this.update_tree();
                this.SelectedGoal = goalForm.Goal;
            }
        }
Exemplo n.º 2
0
 private void EditBtn_Click(object sender, EventArgs e)
 {
     if (this.SelectedGoal != null)
     {
         List <Goal> goal = this.fPartyGoals.FindList(this.SelectedGoal);
         if (goal != null)
         {
             int      num      = goal.IndexOf(this.SelectedGoal);
             GoalForm goalForm = new GoalForm(this.SelectedGoal);
             if (goalForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 goal[num] = goalForm.Goal;
                 this.update_tree();
                 this.SelectedGoal = goalForm.Goal;
             }
         }
     }
 }