void CreateAppoointmentDragInfo() { if (dragInfo == null) { if (AppointmentViewInfo != null) { IsExternalDrag = false; dragInfo = new AppointmentDragInfo() { Appointment = AppointmentViewInfo.Appointment, TimeAtCursor = CurrentDateTime.TimeOfDay, InitialInterval = new TimeInterval(AppointmentViewInfo.Appointment.Start, AppointmentViewInfo.Appointment.End) }; } else if (SelectableIntervalViewInfo != null) { IsExternalDrag = true; dragInfo = new AppointmentDragInfo() { Appointment = null, TimeAtCursor = CurrentDateTime.TimeOfDay, InitialInterval = SelectableIntervalViewInfo.Interval }; } } }
private void SchedulerControl1_AdditionalAppointmentsDrag(object sender, AdditionalAppointmentsDragEventArgs e) { if (e.AdditionalAppointmentInfos.Count <= 0) { return; } AppointmentDragInfo aptInfo = e.AdditionalAppointmentInfos[0]; // If the end of the main dragged appointment becomes greater than the start of the special appointment, // set the start of the special appointment being dragged to the end of the main dragged appointment. // It prevents overlapping appointments. if (e.PrimaryAppointmentInfos[0].EditedAppointment.End > aptInfo.SourceAppointment.Start) { aptInfo.EditedAppointment.Start = e.PrimaryAppointmentInfos[0].EditedAppointment.End; } }
void AppointmentDropHandler(object sender, AppointmentDragEventArgs e) { OnDragDrop(e); dragInfo = null; }