Hi,
I hold some custom information about an appointment object in the Appointment.Tag.... It is an AUDIT Trail, which tracks changes etc.
I need some way of establishing whether an appointment object has been copied. I need to find this information out either during the drag or immediately after.
Once the copy has been made, I want to clear this Tag object and replace it with a brand new Audit trail.
Any ideas?
Thanks In AdvanceAaron
You can exploit the fact that when copies of the originals are made, they are not selected. Thus, when AppointmentsDragComplete fires, if appointments were created during the drag operation, the selected appointments are your "logical" copies:
private bool isDragging = false;private bool hasCopies = false;
void calendarInfo_BeforeAppointmentAdded(object sender, CancelableAppointmentEventArgs e){ if ( this.isDragging ) this.hasCopies = true;}
void dayView_BeforeAppointmentsMoved(object sender, CancelableAppointmentsEventArgs e){ this.isDragging = true;}
void dayView_AppointmentsDragComplete(object sender, AppointmentsDragCompleteEventArgs e){ if ( this.hasCopies ) { // The members of the SelectedAppointments collection are copies // because the original appointments were not selected when they were created. }
this.isDragging = false; this.hasCopies = false;}
Unfortunately I can't use the "AfterAppointmentAdded" routine because the copy behaviour is as such (and please correct me if I am wrong):
This is also explains why when you make a copy of the an appointment there are TWO appointment objects which have changed (If using a dataset/table, then this gives you TWO changed datarows)
I can understand why this behaviour is as it is, but I can't think of any other way to detect if an appointment has been copied and to set some properties on that copied object.
Cheers
Aaron