コード例 #1
0
ファイル: addGoalForm.cs プロジェクト: Gemore/PerfectionV2
 /// <summary>
 /// Constructor for addGoalForm. Takes in a model to get data relating to existing goals.
 /// </summary>
 /// <param name="model"> Perfection model</param>
 public addGoalForm(PerfectionModel model)
 {
     InitializeComponent();
     _model = model;
     _submitted = false;
     _goalToAdd = null;
 }
コード例 #2
0
ファイル: removeGoalForm.cs プロジェクト: Gemore/PerfectionV2
        /// <summary>
        /// Constructor for the removeGoalForm. Sets values and takes in a model. Populates the checkbox with the users goals. Sets submitted to false.
        /// </summary>
        /// <param name="model"></param>
        public removeGoalForm(PerfectionModel model)
        {
            InitializeComponent();
            _model = model;
            _submitted = false;
            _remSolo = false;
            _goalsToRemove = new List<Goal>();

            foreach (Goal g in _model.User.Goals)
            {
                goalChkBx.Items.Add(g);
            }
        }
コード例 #3
0
        /// <summary>
        /// completeGoalForm constructor. Takes in a model and sets default values.
        /// All goals already completed are added to locked completed goal list box.
        /// </summary>
        /// <param name="model">Perfection Model</param>
        public completeGoalForm(PerfectionModel model)
        {
            InitializeComponent();
            _model = model;
            _submitted = false;

            taskCkhBx.Items.Clear();
            shortChkBx.Items.Clear();
            longChkBx.Items.Clear();
            completedBx.Items.Clear();
            _tasksToComplete = new List<TaskGoal>();
            _shortToComplete = new List<ShortTermGoal>();
            _longToComplete = new List<LongTermGoal>();

            foreach (TaskGoal tg in _model.User.Tasks)
            {
                if (!tg.Completed)
                {
                    taskCkhBx.Items.Add(tg);
                }
            }

            foreach (ShortTermGoal sg in _model.User.ShortGoals)
            {
                if (!sg.Completed)
                {
                    shortChkBx.Items.Add(sg);
                }
            }

            foreach (LongTermGoal lg in _model.User.LongGoals)
            {
                if (!lg.Completed)
                {
                    longChkBx.Items.Add(lg);
                }
            }

            foreach (Goal g in _model.User.Goals)
            {
                if (g.Completed)
                {
                    completedBx.Items.Add(g);
                }
            }
        }
コード例 #4
0
 /// <summary>
 /// Default Constuctor, intializes the model.
 /// </summary>
 public PerfectionMain()
 {
     InitializeComponent();
     model = new PerfectionModel();
 }