/// <summary>
 /// Writes elements to XML.
 /// </summary>
 /// <param name="writer">The writer.</param>
 internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
 {
     writer.WriteElementValue(
         XmlNamespace.Types,
         XmlElementNames.StartDate,
         EwsUtilities.DateTimeToXSDate(this.StartDate));
 }
Esempio n. 2
0
        /// <summary>
        /// Writes elements to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
        {
            if (this.Offset.HasValue)
            {
                writer.WriteElementValue(
                    XmlNamespace.Types,
                    XmlElementNames.Offset,
                    EwsUtilities.TimeSpanToXSDuration(this.Offset.Value));
            }

            if (this.Recurrence != null)
            {
                this.Recurrence.WriteToXml(writer, XmlElementNames.RelativeYearlyRecurrence);
            }

            if (this.AbsoluteDate.HasValue)
            {
                writer.WriteElementValue(
                    XmlNamespace.Types,
                    XmlElementNames.AbsoluteDate,
                    EwsUtilities.DateTimeToXSDate(new DateTime(this.AbsoluteDate.Value.Ticks, DateTimeKind.Unspecified)));
            }

            if (this.Time != null)
            {
                writer.WriteElementValue(
                    XmlNamespace.Types,
                    XmlElementNames.Time,
                    this.Time.ToXSTime());
            }
        }
        /// <summary>
        /// Adds the properties to json.
        /// </summary>
        /// <param name="jsonProperty">The json property.</param>
        /// <param name="service">The service.</param>
        internal override void AddPropertiesToJson(JsonObject jsonProperty, ExchangeService service)
        {
            base.AddPropertiesToJson(jsonProperty, service);

            jsonProperty.Add(XmlElementNames.EndDate, EwsUtilities.DateTimeToXSDate(this.EndDate));
        }
 /// <summary>
 /// Adds the properties to json.
 /// </summary>
 /// <param name="jsonProperty">The json property.</param>
 /// <param name="service">The service.</param>
 internal virtual void AddPropertiesToJson(JsonObject jsonProperty, ExchangeService service)
 {
     jsonProperty.AddTypeParameter(this.XmlElementName);
     jsonProperty.Add(XmlElementNames.StartDate, EwsUtilities.DateTimeToXSDate(this.StartDate));
 }