Exemplo n.º 1
0
        private void LoadElements(System.Xml.XmlReader reader)
        {
            while (reader.LocalName != "photo")
            {
                switch (reader.LocalName)
                {
                case "owner":
                    ParseOwner(reader);
                    break;

                case "title":
                    Title = reader.ReadElementContentAsString();
                    break;

                case "description":
                    Description = reader.ReadElementContentAsString();
                    break;

                case "visibility":
                    ParseVisibility(reader);
                    break;

                case "permissions":
                    ParsePermissions(reader);
                    break;

                case "editability":
                    ParseEditability(reader);
                    break;

                case "publiceditability":
                    ParsePublicEditability(reader);
                    break;

                case "dates":
                    ParseDates(reader);
                    break;

                case "usage":
                    ParseUsage(reader);
                    break;

                case "comments":
                    CommentsCount = reader.ReadElementContentAsInt();
                    break;

                case "notes":
                    ParseNotes(reader);
                    break;

                case "tags":
                    ParseTags(reader);
                    break;

                case "urls":
                    ParseUrls(reader);
                    break;

                case "location":
                    Location = new PlaceInfo();
                    ((IFlickrParsable)Location).Load(reader);
                    break;

                case "geoperms":
                    GeoPermissions = new GeoPermissions();
                    ((IFlickrParsable)GeoPermissions).Load(reader);
                    break;

                case "video":
                    VideoInfo = new VideoInfo();
                    ((IFlickrParsable)VideoInfo).Load(reader);
                    break;

                case "people":
                    HasPeople = reader.GetAttribute("haspeople") == "1";
                    reader.Skip();
                    break;

                case "path_alias":
                    PathAlias = reader.Value;
                    break;

                default:
                    Helper.CheckParsingException(reader);
                    reader.Skip();
                    break;
                }
            }

            reader.Skip();
        }
        private void LoadElements(System.Xml.XmlReader reader)
        {
            while (reader.LocalName != "photo")
            {
                switch (reader.LocalName)
                {
                    case "owner":
                        ParseOwner(reader);
                        break;
                    case "title":
                        Title = reader.ReadElementContentAsString();
                        break;
                    case "description":
                        Description = reader.ReadElementContentAsString();
                        break;
                    case "visibility":
                        ParseVisibility(reader);
                        break;
                    case "permissions":
                        ParsePermissions(reader);
                        break;
                    case "editability":
                        ParseEditability(reader);
                        break;
                    case "publiceditability":
                        ParsePublicEditability(reader);
                        break;
                    case "dates":
                        ParseDates(reader);
                        break;
                    case "usage":
                        ParseUsage(reader);
                        break;
                    case "comments":
                        CommentsCount = reader.ReadElementContentAsInt();
                        break;
                    case "notes":
                        ParseNotes(reader);
                        break;
                    case "tags":
                        ParseTags(reader);
                        break;
                    case "urls":
                        ParseUrls(reader);
                        break;
                    case "location":
                        Location = new PlaceInfo();
                        ((IFlickrParsable)Location).Load(reader);
                        break;
                    case "geoperms":
                        GeoPermissions = new GeoPermissions();
                        ((IFlickrParsable)GeoPermissions).Load(reader);
                        break;
                    case "video":
                        VideoInfo = new VideoInfo();
                        ((IFlickrParsable)VideoInfo).Load(reader);
                        break;
                    case "people":
                        HasPeople = reader.GetAttribute("haspeople") == "1";
                        reader.Skip();
                        break;
                    case "path_alias":
                        PathAlias = reader.Value;
                        break;
                    default:
                        Helper.CheckParsingException(reader);
                        reader.Skip();
                        break;

                }
            }

            reader.Skip();
        }