示例#1
0
        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);
                }
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
        }
示例#4
0
 public void RemoveItem(ImageItemRecord item)
 {
     items.Remove(item);
     removedItems.Add(item);
 }