コード例 #1
0
 /// <summary>
 /// Loads from json value.
 /// </summary>
 /// <param name="jsonValue">The json value.</param>
 internal void LoadFromJsonValue(string jsonValue)
 {
     EwsUtilities.ParseEnumValueList <DayOfTheWeek>(
         this.items,
         jsonValue,
         ' ');
 }
コード例 #2
0
        /// <summary>
        /// Loads from json.
        /// </summary>
        /// <param name="jsonProperty">The json property.</param>
        /// <param name="service">The service.</param>
        internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
        {
            foreach (string key in jsonProperty.Keys)
            {
                switch (key)
                {
                case XmlElementNames.DayOfWeek:
                    EwsUtilities.ParseEnumValueList <DayOfTheWeek>(
                        this.daysOfWeek,
                        jsonProperty.ReadAsString(key),
                        ' ');
                    break;

                case XmlElementNames.StartTimeInMinutes:
                    this.startTime = TimeSpan.FromMinutes(jsonProperty.ReadAsInt(key));
                    break;

                case XmlElementNames.EndTimeInMinutes:
                    this.endTime = TimeSpan.FromMinutes(jsonProperty.ReadAsInt(key));
                    break;

                default:
                    break;
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Loads from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="xmlElementName">Name of the XML element.</param>
        internal override void LoadFromXml(EwsServiceXmlReader reader, string xmlElementName)
        {
            reader.EnsureCurrentNodeIsStartElement(XmlNamespace.Types, xmlElementName);

            EwsUtilities.ParseEnumValueList <DayOfTheWeek>(
                this.items,
                reader.ReadElementValue(),
                ' ');
        }
コード例 #4
0
        /// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>True if appropriate element was read.</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            switch (reader.LocalName)
            {
            case XmlElementNames.DayOfWeek:
                EwsUtilities.ParseEnumValueList <DayOfTheWeek>(
                    this.daysOfWeek,
                    reader.ReadElementValue(),
                    ' ');
                return(true);

            case XmlElementNames.StartTimeInMinutes:
                this.startTime = TimeSpan.FromMinutes(reader.ReadElementValue <int>());
                return(true);

            case XmlElementNames.EndTimeInMinutes:
                this.endTime = TimeSpan.FromMinutes(reader.ReadElementValue <int>());
                return(true);

            default:
                return(false);
            }
        }