Example #1
0
            /// <summary>
            /// Write properties to XML.
            /// </summary>
            /// <param name="writer">The writer.</param>
            internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)
            {
                base.InternalWritePropertiesToXml(writer);

                this.DaysOfTheWeek.WriteToXml(writer, XmlElementNames.DaysOfWeek);

                if (this.firstDayOfWeek.HasValue)
                {
                    //  We only allow the "FirstDayOfWeek" parameter for the Exchange2010_SP1 schema
                    //  version.
                    //
                    EwsUtilities.ValidatePropertyVersion(
                        (ExchangeService)writer.Service,
                        ExchangeVersion.Exchange2010_SP1,
                        "FirstDayOfWeek");

                    writer.WriteElementValue(
                        XmlNamespace.Types,
                        XmlElementNames.FirstDayOfWeek,
                        this.firstDayOfWeek.Value);
                }
            }
Example #2
0
            /// <summary>
            /// Patterns to json.
            /// </summary>
            /// <param name="service">The service.</param>
            /// <returns></returns>
            internal override JsonObject PatternToJson(ExchangeService service)
            {
                JsonObject jsonPattern = base.PatternToJson(service);

                jsonPattern.Add(XmlElementNames.DayOfWeek, this.DaysOfTheWeek.InternalToJson(service));

                if (this.firstDayOfWeek.HasValue)
                {
                    //  We only allow the "FirstDayOfWeek" parameter for the Exchange2010_SP1 schema
                    //  version.
                    //
                    EwsUtilities.ValidatePropertyVersion(
                        service,
                        ExchangeVersion.Exchange2010_SP1,
                        "FirstDayOfWeek");

                    jsonPattern.Add(
                        XmlElementNames.FirstDayOfWeek,
                        this.firstDayOfWeek.Value);
                }

                return(jsonPattern);
            }