/// <summary>
        /// Writes to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="propertyBag">The property bag.</param>
        /// <param name="isUpdateOperation">Indicates whether the context is an update operation.</param>
        internal override void WritePropertyValueToXml(
            EwsServiceXmlWriter writer,
            PropertyBag propertyBag,
            bool isUpdateOperation)
        {
            Misc.CustomTimeZoneInfo value = (Misc.CustomTimeZoneInfo)propertyBag[this];

            if (value != null)
            {
                // We emit time zone properties only if we have not emitted the time zone SOAP header
                // or if this time zone is different from that of the service through which the request
                // is being emitted.
                if (!writer.IsTimeZoneHeaderEmitted || /*value != writer.Service.TimeZone*/ !value.Equals(writer.Service.TimeZone))
                {
                    TimeZoneDefinition timeZoneDefinition = new TimeZoneDefinition(value);

                    timeZoneDefinition.WriteToXml(writer, this.XmlElementName);
                }
            }
        }