Person.LoadElements - doesn't recognize "timezone" nor "description"

Jan 22, 2012 at 10:19 AM

Hi,

Don't know if this is a known issue. It seems that Person.LoadElements( ) chokes on some (newly?) returned values.  See last two cases in the switch stmt below.

I didn't really know how to fix it properly so please advise if there's a better way.

PS: I'm also in doubt whether it's better to throw an exception  or just plough on in such a case.

Thanks,

Lambert

 

       private void LoadElements(System.Xml.XmlReader reader)
        {
            while (reader.LocalName != "person")
            {
                switch (reader.LocalName)
                {
                    case "username":
                        UserName = reader.ReadElementContentAsString();
                        break;
                    case "location":
                        Location = reader.ReadElementContentAsString();
                        break;
                    case "realname":
                        RealName = reader.ReadElementContentAsString();
                        break;
                    case "photosurl":
                        PhotosUrl = reader.ReadElementContentAsString();
                        break;
                    case "profileurl":
                        ProfileUrl = reader.ReadElementContentAsString();
                        break;
                    case "mobileurl":
                        MobileUrl = reader.ReadElementContentAsString();
                        break;
                    case "photos":
                        PhotosSummary = new PersonPhotosSummary();
                        ((IFlickrParsable)PhotosSummary).Load(reader);
                        break;
                    case "mbox_sha1sum":
                        MailboxSha1Hash = reader.ReadElementContentAsString();
                        break;
                    // LWM:
                    case "timezone" :
                    case "description" : 
                        reader.ReadElementContentAsString();
                        break;
                    default:
                        UtilityMethods.CheckParsingException(reader);
                        reader.Skip();
                        break;
                }
            }
        }

Coordinator
Jan 23, 2012 at 9:07 AM

These changes have now been added to the source code. Thanks for pointing them out.

Sam

Feb 18, 2012 at 5:22 AM

Thank you for addressing this,

Lambert