Ejemplo n.º 1
0
        /// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>True if element was read.</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            switch (reader.LocalName)
            {
                case XmlElementNames.Offset:
                    this.offset = EwsUtilities.XSDurationToTimeSpan(reader.ReadElementValue());
                    return true;
                case XmlElementNames.RelativeYearlyRecurrence:
                    this.Recurrence = new TimeChangeRecurrence();
                    this.Recurrence.LoadFromXml(reader, reader.LocalName);
                    return true;
                case XmlElementNames.AbsoluteDate:
                    DateTime dateTime = DateTime.Parse(reader.ReadElementValue());

                    // TODO: BUG
                    this.absoluteDate = new DateTime(dateTime.ToUniversalTime().Ticks, DateTimeKind.Unspecified);
                    return true;
                case XmlElementNames.Time:
                    this.time = new Time(DateTime.Parse(reader.ReadElementValue()));
                    return true;
                default:
                    return false;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TimeChange"/> class.
 /// </summary>
 /// <param name="offset">The offset since the beginning of the year when the change occurs.</param>
 /// <param name="time">The time at which the change occurs.</param>
 public TimeChange(TimeSpan offset, Time time)
     : this(offset)
 {
     this.time = time;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TimeChange"/> class.
 /// </summary>
 /// <param name="offset">The offset since the beginning of the year when the change occurs.</param>
 /// <param name="time">The time at which the change occurs.</param>
 public TimeChange(TimeSpan offset, Time time)
     : this(offset)
 {
     this.time = time;
 }