コード例 #1
0
        public ViewerForm(Form1 MainForm, Backend.Event UserEvent)
        {
            InitializeComponent();

            this.MainForm  = MainForm;
            this.UserEvent = UserEvent;
        }
コード例 #2
0
        public void CreateEvent(Backend.Event tempEvent)
        {
            // give the current user the built event from the event form
            tempEvent.StartTime = tempEvent.StartDate;
            CurrentUser.Events.Add(tempEvent);
            CurrentUser.Events = CurrentUser.Events.OrderBy(d => d.StartDate).ToList();

            // update the UI with this event item
            UpdateInterface();
        }
コード例 #3
0
        // pass in an event, and try to remove it from the currently selected user
        public void DeleteEvent(Backend.Event UserEvent)
        {
            int index = CurrentUser.Events.IndexOf(UserEvent);

            // exit if it was not found
            if (index == -1)
            {
                return;
            }

            // remove the event and update interface
            CurrentUser.Events.RemoveAt(index);
            UpdateInterface();
        }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveButton_Click(object sender, EventArgs e)
        {
            Backend.Event temp = new Backend.Event(
                SubjectTextBox.Text,
                AllDayCheckBox.Checked,
                StartDateTimePicker.Value.Date,
                DateTime.Parse(StartTimeComboBox.SelectedItem.ToString()),
                FinishDateTimePicker.Value.Date,
                DateTime.Parse(FinishTimeComboBox.SelectedItem.ToString()),
                RepeatCheckBox.Checked,
                RepeatOccurrencesComboBox.Text,
                LocationTextBox.Text,
                PriorityComboBox.Text,
                DescriptionTextBox.Text);

            MainForm.CreateEvent(temp);
            Close();
        }