void IFlickrParsable.Load(XmlReader reader) { while (reader.MoveToNextAttribute()) { switch (reader.LocalName) { case "nsid": case "id": GroupId = reader.Value; break; case "iconserver": IconServer = reader.Value; break; case "iconfarm": IconFarm = reader.Value; break; case "lang": Language = reader.Value; break; case "ispoolmoderated": IsPoolModerated = reader.Value == "1"; break; default: UtilityMethods.CheckParsingException(reader); break; } } reader.Read(); while (reader.LocalName != "group") { switch (reader.LocalName) { case "name": GroupName = reader.ReadElementContentAsString(); break; case "description": Description = reader.ReadElementContentAsString(); break; case "members": Members = reader.ReadElementContentAsInt(); break; case "privacy": Privacy = (PoolPrivacy)reader.ReadElementContentAsInt(); break; case "blast": BlastDateAdded = UtilityMethods.UnixTimestampToDate(reader.GetAttribute("date_blast_added")); BlastUserId = reader.GetAttribute("user_id"); BlastHtml = reader.ReadElementContentAsString(); break; case "throttle": ThrottleInfo = new GroupThrottleInfo(); ((IFlickrParsable)ThrottleInfo).Load(reader); break; case "restrictions": Restrictions = new GroupInfoRestrictions(); ((IFlickrParsable)Restrictions).Load(reader); break; case "roles": MemberRoleName = reader.GetAttribute("member"); ModeratorRoleName = reader.GetAttribute("moderator"); AdminRoleName = reader.GetAttribute("admin"); reader.Read(); break; case "rules": Rules = reader.ReadElementContentAsString(); break; case "pool_count": PoolCount = reader.ReadElementContentAsInt(); break; case "topic_count": TopicCount = reader.ReadElementContentAsInt(); break; default: UtilityMethods.CheckParsingException(reader); reader.Skip(); break; } } reader.Read(); }
void IFlickrParsable.Load(XmlReader reader) { while (reader.MoveToNextAttribute()) { switch (reader.LocalName) { case "nsid": case "id": GroupId = reader.Value; break; case "iconserver": IconServer = reader.Value; break; case "iconfarm": IconFarm = reader.Value; break; case "lang": Language = reader.Value; break; case "ispoolmoderated": IsPoolModerated = reader.Value == "1"; break; default: UtilityMethods.CheckParsingException(reader); break; } } reader.Read(); while (reader.LocalName != "group") { switch (reader.LocalName) { case "name": GroupName = reader.ReadElementContentAsString(); break; case "description": Description = reader.ReadElementContentAsString(); break; case "members": Members = reader.ReadElementContentAsInt(); break; case "privacy": Privacy = (PoolPrivacy)reader.ReadElementContentAsInt(); break; case "blast": BlastDateAdded = UtilityMethods.UnixTimestampToDate(reader.GetAttribute("date_blast_added")); BlastUserId = reader.GetAttribute("user_id"); BlastHtml = reader.ReadElementContentAsString(); break; case "throttle": ThrottleInfo = new GroupThrottleInfo(); ((IFlickrParsable)ThrottleInfo).Load(reader); break; case "restrictions": Restrictions = new GroupInfoRestrictions(); ((IFlickrParsable)Restrictions).Load(reader); break; default: UtilityMethods.CheckParsingException(reader); reader.Skip(); break; } } reader.Read(); }