Ejemplo n.º 1
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)
        {
            if (jsonProperty.ContainsKey(XmlElementNames.OperationIndex))
            {
                this.operationIndex = jsonProperty.ReadAsInt(XmlElementNames.OperationIndex);
            }

            if (jsonProperty.ContainsKey(XmlElementNames.ValidationErrors))
            {
                this.ruleErrors = new RuleErrorCollection();
                (this.ruleErrors as IJsonCollectionDeserializer).CreateFromJsonCollection(jsonProperty.ReadAsArray(XmlElementNames.ValidationErrors), service);
            }
        }
Ejemplo n.º 2
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.OperationIndex:
                this.operationIndex = reader.ReadElementValue <int>();
                return(true);

            case XmlElementNames.ValidationErrors:
                this.ruleErrors = new RuleErrorCollection();
                this.ruleErrors.LoadFromXml(reader, reader.LocalName);
                return(true);

            default:
                return(false);
            }
        }