Пример #1
0
 void IFlickrParsable.Load(XmlReader reader)
 {
     if (!(reader.LocalName != "photos"))
     ;
       while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "total":
     this.Total = string.IsNullOrEmpty(reader.Value) ? 0 : int.Parse(reader.Value, (IFormatProvider) CultureInfo.InvariantCulture);
     continue;
       case "perpage":
       case "per_page":
     this.PerPage = string.IsNullOrEmpty(reader.Value) ? 0 : int.Parse(reader.Value, (IFormatProvider) CultureInfo.InvariantCulture);
     continue;
       case "page":
     this.Page = string.IsNullOrEmpty(reader.Value) ? 0 : int.Parse(reader.Value, (IFormatProvider) CultureInfo.InvariantCulture);
     continue;
       case "pages":
     this.Pages = string.IsNullOrEmpty(reader.Value) ? 0 : int.Parse(reader.Value, (IFormatProvider) CultureInfo.InvariantCulture);
     continue;
       default:
     continue;
     }
       }
       reader.Read();
       while (reader.LocalName == "photo")
       {
     Photo photo = new Photo();
     photo.Load(reader);
     if (!string.IsNullOrEmpty(photo.PhotoId))
       this.Add(photo);
       }
       reader.Skip();
 }
Пример #2
0
 void IFlickrParsable.Load(XmlReader reader)
 {
     if (!(reader.LocalName != "photoset"))
     ;
       while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "id":
     this.PhotosetId = reader.Value;
     continue;
       case "primary":
     this.PrimaryPhotoId = reader.Value;
     continue;
       case "owner":
     this.OwnerId = reader.Value;
     continue;
       case "ownername":
     this.OwnerName = reader.Value;
     continue;
       case "page":
     this.Page = int.Parse(reader.Value, (IFormatProvider) NumberFormatInfo.InvariantInfo);
     continue;
       case "total":
     this.Total = int.Parse(reader.Value, (IFormatProvider) NumberFormatInfo.InvariantInfo);
     continue;
       case "pages":
     this.Pages = int.Parse(reader.Value, (IFormatProvider) NumberFormatInfo.InvariantInfo);
     continue;
       case "perpage":
       case "per_page":
     this.PerPage = int.Parse(reader.Value, (IFormatProvider) NumberFormatInfo.InvariantInfo);
     continue;
       case "title":
     this.Title = reader.Value;
     continue;
       default:
     continue;
     }
       }
       reader.Read();
       while (reader.LocalName == "photo")
       {
     Photo photo = new Photo();
     photo.Load(reader);
     if (string.IsNullOrEmpty(photo.UserId))
       photo.UserId = this.OwnerId;
     this.Add(photo);
       }
       reader.Skip();
 }
Пример #3
0
 void IFlickrParsable.Load(XmlReader reader)
 {
     if (!(reader.LocalName != "collection"))
     ;
       while (reader.MoveToNextAttribute())
       {
     switch (reader.Name)
     {
       case "id":
     this.CollectionId = reader.Value;
     continue;
       case "child_count":
     this.ChildCount = int.Parse(reader.Value, (IFormatProvider) CultureInfo.InvariantCulture);
     continue;
       case "datecreate":
     this.DateCreated = UtilityMethods.UnixTimestampToDate(reader.Value);
     continue;
       case "iconlarge":
     this.IconLarge = reader.Value;
     continue;
       case "iconsmall":
     this.IconSmall = reader.Value;
     continue;
       case "server":
     this.Server = reader.Value;
     continue;
       case "secret":
     this.Secret = reader.Value;
     continue;
       default:
     continue;
     }
       }
       reader.Read();
       while (reader.LocalName != "collection")
       {
     switch (reader.Name)
     {
       case "title":
     this.Title = reader.ReadElementContentAsString();
     continue;
       case "description":
     this.Description = reader.ReadElementContentAsString();
     continue;
       case "iconphotos":
     reader.Read();
     while (reader.LocalName == "photo")
     {
       Photo photo = new Photo();
       photo.Load(reader);
       this.iconPhotos.Add(photo);
     }
     reader.Read();
     return;
       default:
     continue;
     }
       }
       reader.Skip();
 }