Пример #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);
 }