GetIsTimeZoneHeaderRequired method

  1. @override
bool GetIsTimeZoneHeaderRequired(
  1. bool isUpdateOperation
)
override
Gets a value indicating whether a time zone SOAP header should be emitted in a CreateItem or UpdateItem request so this item can be property saved or updated. Indicates whether the operation being petrformed is an update operation.

Implementation

@override
bool GetIsTimeZoneHeaderRequired(bool isUpdateOperation) {
  if (isUpdateOperation) {
    return false;
  } else {
//                bool isStartTimeZoneSetOrUpdated = this.PropertyBag.IsPropertyUpdated(AppointmentSchema.StartTimeZone);
//                bool isEndTimeZoneSetOrUpdated = this.PropertyBag.IsPropertyUpdated(AppointmentSchema.EndTimeZone);

//                if (isStartTimeZoneSetOrUpdated && isEndTimeZoneSetOrUpdated)
    if (true) {
      // todo restore time zone info
      print(".. skip time zone info");
      return false;
      // If both StartTimeZone and EndTimeZone have been set or updated and are the same as the service's
      // time zone, we emit the time zone header and StartTimeZone and EndTimeZone are not emitted.
//                    TimeZoneInfo startTimeZone;
//                    TimeZoneInfo endTimeZone;

//                    this.PropertyBag.TryGetProperty<TimeZoneInfo>(AppointmentSchema.StartTimeZone, out startTimeZone);
//                    this.PropertyBag.TryGetProperty<TimeZoneInfo>(AppointmentSchema.EndTimeZone, out endTimeZone);

//                    return startTimeZone == this.Service.TimeZone || endTimeZone == this.Service.TimeZone;
    } else {
      return true;
    }
  }
}