Exemplo n.º 1
0
        /// <summary>
        /// Should only update the model, all interested views should be updated through the event generated by the model.
        /// </summary>
        /// <param name="node"></param>
        private void SetDueDateUsingPicker(MapNode node)
        {
            // initialize date time picker
            if (node.DueDateExists())
            {
                dateTimePicker.Value = node.GetDueDate();
            }
            else
            {
                dateTimePicker.Value = DateHelper.GetDefaultDueDate();
            }

            // show and set due dates
            if (dateTimePicker.ShowDialog() == DialogResult.OK)
            {
                node.AddTask(dateTimePicker.Value);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Sets the date component of DueDate. Time component is set if it is empty, otherwise left unchanged.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="dueDate"></param>
 private void SetDueDateKeepTimePart(MapNode node, DateTime dueDate)
 {
     if (node.DueDateExists())
         dueDate = dueDate.Date.Add(node.GetDueDate().TimeOfDay);
     node.AddTask(dueDate);
 }