Пример #1
0
 /// <summary>
 /// When the user double-clicks a day on the calendar control, we allow him to add a new entry.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="DaySelectedEventArgs"/> instance containing the event data.</param>
 private void calControl_DayDoubleClicked(object sender, DaySelectedEventArgs e)
 {
     AddScheduleEntry(e.DateTime);
 }
Пример #2
0
        /// <summary>
        /// When the user clicks the calendar controls (main control)
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DaySelectedEventArgs"/> instance containing the event data.</param>
        private void calControl_DayClicked(object sender, DaySelectedEventArgs e)
        {
            UpdateDateTimeControls(e.DateTime);

            if (!e.DateTimeIsSameMonthAsPrevious)
                return;

            switch (e.Mouse.Button)
            {
                case MouseButtons.Left:
                    ShowCalendarTooltip(e.DateTime);
                    break;
                case MouseButtons.Right:
                    ShowCalendarContextMenu(e.DateTime, e.Location);
                    break;
            }
        }