Example #1
0
        public void RemoveActivityBtn_Click(object sender, RoutedEventArgs e)
        {
            RemovingActivityCtrlErr error = _activitiesManager.RemoveSelectedActivity();

            switch (error)
            {
            case RemovingActivityCtrlErr.NoError:
            {
                _week.SaveData();
                _week.UpdateView();
                break;
            }

            case RemovingActivityCtrlErr.NoneActivitySelected:
            {
                System.Windows.Forms.MessageBox.Show("None of activities has been selected!", "None activity " +
                                                     "selected", MessageBoxButtons.OK, MessageBoxIcon.Error);
                break;
            }

            case RemovingActivityCtrlErr.NothingActivityRemovingAttmpt:
            {
                System.Windows.Forms.MessageBox.Show("You cannot delete \"Nothing\" pseudoactivity!", "Attempt" +
                                                     " to remove \"Nothing\"", MessageBoxButtons.OK, MessageBoxIcon.Error);
                break;
            }
            }
        }
Example #2
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     _week.SaveData();
 }