internal Photo(ImageItemRecord item, PhotoDatabase db) { this.item = item; this.db = db; foreach (ImageNameRecord name in item.Names) { try { thumbnails.Add(new Thumbnail(this, name)); } catch (Exception e) { Console.Error.WriteLine("ipod-sharp: Failed to read thumbnail: " + e.Message); } } }
public override void Read(BinaryReader reader) { base.Read(reader); byte[] body = reader.ReadBytes(this.HeaderOne - 12); recordPadding = body.Length; for (int i = 0; i < this.HeaderTwo; i++) { ImageItemRecord item = new ImageItemRecord(IsBE); item.Read(reader); items.Add(item); } }
public Photo CreatePhoto() { ImageListRecord imageList = dfr[PhotoDataSetIndex.ImageList].Data as ImageListRecord; ImageItemRecord item = new ImageItemRecord(device.IsBE); item.Id = dfr.NextId++; imageList.AddItem(item); Photo photo = new Photo(item, this); photos[photo.Id] = photo; if (masterAlbum != null) { masterAlbum.Add(photo); } addedPhotos.Add(photo); return(photo); }
public void RemoveItem(ImageItemRecord item) { items.Remove(item); removedItems.Add(item); }