public void MouseDown(System.Windows.Forms.MouseEventArgs e) { if (m_dayView.SelectedAppointmentIsNew) { m_dayView.RaiseNewAppointment(); } else { m_dayView.RaiseSelectionChanged(new AppointmentEventArgs(m_dayView.SelectedAppointment)); } if (m_dayView.CurrentlyEditing) { m_dayView.FinishEditing(false); } m_mode = GetMode(e.Location); if (m_mode != Mode.None) { // Calculate delta time between selection and clicked point if (m_dayView.SelectedAppointment != null) { DateTime downPos = m_dayView.GetDateTimeAt(e.X, e.Y); m_delta = m_dayView.SelectedAppointment.StartDate - downPos; } else { m_delta = TimeSpan.Zero; } m_length = TimeSpan.Zero; m_lastMouseMove = e.Location; } }
public void MouseUp(System.Windows.Forms.MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (Complete != null) { Complete(this, EventArgs.Empty); } } dayView.RaiseSelectionChanged(EventArgs.Empty); mode = Mode.Move; delta = TimeSpan.Zero; }
public void MouseUp(System.Windows.Forms.MouseEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (Complete != null) { Complete(this, EventArgs.Empty); } } dayView.RaiseSelectionChanged(new AppointmentEventArgs(dayView.SelectedAppointment)); dayView.RaiseAppointmentMove(new MoveAppointmentEventArgs(dayView.SelectedAppointment, mode, true)); mode = Mode.Move; delta = TimeSpan.Zero; }
public void MouseUp(System.Windows.Forms.MouseEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (GetMode(e) == SelectionMode.Move) { if (dayView.SelectedAppointment.AppointmentMoved) { dayView.SelectedAppointment.AppointmentMoved = false; dayView.RaiseAppointmentMoved(new AppointmentEventArgs(dayView.SelectedAppointment)); dayView.SelectedAppointment = null; dayView.Invalidate(); } } if (Complete != null) { Complete(this, EventArgs.Empty); } } dayView.RaiseSelectionChanged(EventArgs.Empty); mode = SelectionMode.Move; delta = TimeSpan.Zero; if (dayView.Cursor != System.Windows.Forms.Cursors.Default) { dayView.Cursor = System.Windows.Forms.Cursors.Default; } }