Photo.Load( ) doesn't recognize "context"

Topics: Developer Forum
Jan 22, 2012 at 11:22 AM

See my previous post about Person.LoadElements.

Same story here:

       /// <summary>
        /// Protected method that does the actual initialization of the Photo instance. Should be called by subclasses of the Photo class.
        /// </summary>
        /// <param name="reader">The reader containing the XML to be parsed.</param>
        /// <param name="allowExtraAtrributes">Wheither to allow unknown extra attributes. In debug builds will throw an exception if this parameter is false and an unknown attribute is found.</param>
        protected void Load(XmlReader reader, bool allowExtraAtrributes)
        {
            if (reader.LocalName != "photo")
                UtilityMethods.CheckParsingException(reader);

            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "id":
                        PhotoId = reader.Value;
                        if (String.IsNullOrEmpty(reader.Value))
                        {
                            reader.Skip();
                            return;
                        }
                        break;

// ................ 
// ................ 

                   case "geo_is_contact":
                        if (GeoPermissions == null)
                        {
                            GeoPermissions = new GeoPermissions(); 
                            GeoPermissions.PhotoId = PhotoId;
                        }
                        GeoPermissions.IsContact = reader.Value == "1";
                        break;
                    // LWM: 
                    case "context":
                        reader.ReadContentAsString();
                        break;
                    default:
                        if (!allowExtraAtrributes) UtilityMethods.CheckParsingException(reader);
                        break;
                }
            }

            reader.Read();

            if (reader.LocalName == "description")
                Description = reader.ReadElementContentAsString();

        }
    }

 

Coordinator
Jan 22, 2012 at 12:19 PM

I'll add these to the source. If you use a release build of the DLL you wouldn't experience an issue as these would just be skipped.

Sam

Coordinator
Jan 23, 2012 at 10:31 AM

GeoContext added to the Photo class.

Feb 18, 2012 at 6:21 AM

Great, thanks!