Validate method
Validates this instance.
Implementation
@override
void Validate() {
super.Validate();
// Make sure that if we're on the Exchange2007_SP1 schema version, if any of the following
// properties are set or updated:
// o Start
// o End
// o IsAllDayEvent
// o Recurrence
// ... then, we must send the MeetingTimeZone element (which is generated from StartTimeZone for
// Exchange2007_SP1 requests (see StartTimeZonePropertyDefinition.cs). If the StartTimeZone isn't
// in the property bag, then throw, because clients must supply the proper time zone - either by
// loading it from a currently-existing appointment, or by setting it directly. Otherwise, to dirty
// the StartTimeZone property, we just set it to its current value.
if ((Service.RequestedServerVersion == ExchangeVersion.Exchange2007_SP1) &&
!Service.Exchange2007CompatibilityMode) {
// throw UnimplementedError("Appointment.Validate");
if (PropertyBag.IsPropertyUpdated(AppointmentSchema.Start) ||
PropertyBag.IsPropertyUpdated(AppointmentSchema.End) ||
PropertyBag.IsPropertyUpdated(AppointmentSchema.IsAllDayEvent) ||
PropertyBag.IsPropertyUpdated(AppointmentSchema.Recurrence)) {
// If the property isn't in the property bag, throw....
// C# throws StartTimeZoneRequired when the property is missing, but it is
// always preset there (TimeZoneInfo.Local). A Dart service has no time zone
// unless one is set, so without one the server keeps scoping to UTC as before.
if (PropertyBag.Contains(AppointmentSchema.StartTimeZone)) {
// Set the time zone to its current value to force it to be sent with the request.
PropertyBag[AppointmentSchema.StartTimeZone] =
PropertyBag[AppointmentSchema.StartTimeZone];
}
}
}
}