예제 #1
0
        /// <summary>
        /// Loads from json.
        /// </summary>
        /// <param name="jsonProperty">The json property.</param>
        /// <param name="service"></param>
        internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
        {
            foreach (string key in jsonProperty.Keys)
            {
                switch (key)
                {
                case XmlElementNames.LocationDisplayName:
                    this.displayName = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.LocationAnnotation:
                    this.annotation = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.PersonaPostalAddress:
                    this.personaPostalAddress = new PersonaPostalAddress();
                    this.personaPostalAddress.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
                    this.personaPostalAddress.OnChange += new ComplexPropertyChangedDelegate(PersonaPostalAddress_OnChange);
                    break;

                default:
                    break;
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EnhancedLocation"/> class.
 /// </summary>
 /// <param name="displayName">The location DisplayName.</param>
 /// <param name="annotation">The annotation on the location.</param>
 /// <param name="personaPostalAddress">The persona postal address.</param>
 public EnhancedLocation(string displayName, string annotation, PersonaPostalAddress personaPostalAddress)
     : this()
 {
     this.displayName                    = displayName;
     this.annotation                     = annotation;
     this.personaPostalAddress           = personaPostalAddress;
     this.personaPostalAddress.OnChange += new ComplexPropertyChangedDelegate(PersonaPostalAddress_OnChange);
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EnhancedLocation"/> class.
 /// </summary>
 /// <param name="displayName">The location DisplayName.</param>
 /// <param name="annotation">The annotation on the location.</param>
 /// <param name="personaPostalAddress">The persona postal address.</param>
 public EnhancedLocation(string displayName, string annotation, PersonaPostalAddress personaPostalAddress)
     : this()
 {
     this.displayName = displayName;
     this.annotation = annotation;
     this.personaPostalAddress = personaPostalAddress;
     this.personaPostalAddress.OnChange += new ComplexPropertyChangedDelegate(PersonaPostalAddress_OnChange);
 }
예제 #4
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.LocationDisplayName:
                this.displayName = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.LocationAnnotation:
                this.annotation = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.PersonaPostalAddress:
                this.personaPostalAddress = new PersonaPostalAddress();
                this.personaPostalAddress.LoadFromXml(reader);
                this.personaPostalAddress.OnChange += new ComplexPropertyChangedDelegate(PersonaPostalAddress_OnChange);
                return(true);

            default:
                return(false);
            }
        }
예제 #5
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.LocationDisplayName:
             this.displayName = reader.ReadValue<string>();
             return true;
         case XmlElementNames.LocationAnnotation:
             this.annotation = reader.ReadValue<string>();
             return true;
         case XmlElementNames.PersonaPostalAddress:
             this.personaPostalAddress = new PersonaPostalAddress();
             this.personaPostalAddress.LoadFromXml(reader);
             this.personaPostalAddress.OnChange += new ComplexPropertyChangedDelegate(PersonaPostalAddress_OnChange);
             return true;
         default:
             return false;
     }
 }