/// <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)
            {
                base.LoadFromJson(jsonProperty, service);

                this.value           = jsonProperty.ReadAsJsonObject(XmlElementNames.Constant).ReadAsString(XmlElementNames.Value);
                this.containmentMode = jsonProperty.ReadEnumValue <ContainmentMode>(XmlAttributeNames.ContainmentMode);
                this.comparisonMode  = jsonProperty.ReadEnumValue <ComparisonMode>(XmlAttributeNames.ContainmentComparison);
            }
 /// <summary>
 /// Initializes a new instance of the <see cref="ContainsSubstring"/> class.
 /// </summary>
 /// <param name="propertyDefinition">The definition of the property that is being compared. Property definitions are available as static members from schema classes (for example, EmailMessageSchema.Subject, AppointmentSchema.Start, ContactSchema.GivenName, etc.)</param>
 /// <param name="value">The value to compare with.</param>
 /// <param name="containmentMode">The containment mode.</param>
 /// <param name="comparisonMode">The comparison mode.</param>
 public ContainsSubstring(
     PropertyDefinitionBase propertyDefinition,
     string value,
     ContainmentMode containmentMode,
     ComparisonMode comparisonMode)
     : this(propertyDefinition, value)
 {
     this.containmentMode = containmentMode;
     this.comparisonMode  = comparisonMode;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ContainsSubstring"/> class.
 /// </summary>
 /// <param name="propertyDefinition">The definition of the property that is being compared. Property definitions are available as static members from schema classes (for example, EmailMessageSchema.Subject, AppointmentSchema.Start, ContactSchema.GivenName, etc.)</param>
 /// <param name="value">The value to compare with.</param>
 /// <param name="containmentMode">The containment mode.</param>
 /// <param name="comparisonMode">The comparison mode.</param>
 public ContainsSubstring(
     PropertyDefinitionBase propertyDefinition,
     string value,
     ContainmentMode containmentMode,
     ComparisonMode comparisonMode)
     : this(propertyDefinition, value)
 {
     this.containmentMode = containmentMode;
     this.comparisonMode = comparisonMode;
 }
            /// <summary>
            /// Reads the attributes from XML.
            /// </summary>
            /// <param name="reader">The reader.</param>
            internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
            {
                base.ReadAttributesFromXml(reader);

                this.containmentMode = reader.ReadAttributeValue <ContainmentMode>(XmlAttributeNames.ContainmentMode);

                try
                {
                    this.comparisonMode = reader.ReadAttributeValue <ComparisonMode>(XmlAttributeNames.ContainmentComparison);
                }
                catch (ArgumentException)
                {
                    // This will happen if we receive a value that is defined in the EWS schema but that is not defined
                    // in the API (see the comments in ComparisonMode.cs). We map that value to IgnoreCaseAndNonSpacingCharacters.
                    this.comparisonMode = ComparisonMode.IgnoreCaseAndNonSpacingCharacters;
                }
            }
            /// <summary>
            /// Reads the attributes from XML.
            /// </summary>
            /// <param name="reader">The reader.</param>
            internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
            {
                base.ReadAttributesFromXml(reader);

                this.containmentMode = reader.ReadAttributeValue<ContainmentMode>(XmlAttributeNames.ContainmentMode);

                try
                {
                    this.comparisonMode = reader.ReadAttributeValue<ComparisonMode>(XmlAttributeNames.ContainmentComparison);
                }
                catch (ArgumentException)
                {
                    // This will happen if we receive a value that is defined in the EWS schema but that is not defined
                    // in the API (see the comments in ComparisonMode.cs). We map that value to IgnoreCaseAndNonSpacingCharacters.
                    this.comparisonMode = ComparisonMode.IgnoreCaseAndNonSpacingCharacters;
                }
            }