~ubuntu-branches/ubuntu/quantal/ipod-sharp/quantal

« back to all changes in this revision

Viewing changes to src/Album.cs

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-11-13 12:36:39 UTC
  • mfrom: (1.1.4 upstream) (6.1.5 edgy)
  • Revision ID: james.westby@ubuntu.com-20061113123639-cynm2axegef1etff
* New upstream release
* debian/patches/01_fix-playcounts.patch:
  + Dropped, merged upstream
* debian/control:
  + Build depend on mono-gmcs, libmono-sharpzip2.84-cil, libmono2.0-cil,
    libglib2.0-dev and libipoddevice >= 0.5.0
  + Bumped Standards-Version to 3.7.2
  + Add ${misc:Depends} to Depends
  + Let libipodui-cil depend on libipod-cil
* debian/libipod-cil.install:
  + Add ipod-sharp-firmware.dll
* debian/patches/01_dllmap.patch:
  + Add dllmap to libgobject-2.0.so.0 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.Collections.ObjectModel;
 
3
using System.Collections.Generic;
 
4
 
 
5
namespace IPod {
 
6
 
 
7
    public class Album {
 
8
 
 
9
        private AlbumRecord record;
 
10
 
 
11
        private List<Photo> photos;
 
12
 
 
13
        public ReadOnlyCollection<Photo> Photos {
 
14
            get {
 
15
                return new ReadOnlyCollection<Photo> (photos);
 
16
            }
 
17
        }
 
18
 
 
19
        public string Name {
 
20
            get { return record.AlbumName; }
 
21
            set { record.AlbumName = value; }
 
22
        }
 
23
 
 
24
        internal bool IsMaster {
 
25
            get { return record.IsMaster; }
 
26
        }
 
27
 
 
28
        internal AlbumRecord Record {
 
29
            get { return record; }
 
30
        }
 
31
        
 
32
        internal Album (AlbumRecord record, PhotoDatabase db) {
 
33
            this.record = record;
 
34
 
 
35
            photos = new List<Photo> ();
 
36
 
 
37
            foreach (AlbumItemRecord item in record.Items) {
 
38
                Photo photo = db.LookupPhotoById (item.Id);
 
39
                photos.Add (photo);
 
40
            }
 
41
        }
 
42
 
 
43
        public void Add (Photo photo) {
 
44
            record.AddItem (new AlbumItemRecord (record.IsBE, photo.Id));
 
45
            photos.Add (photo);
 
46
        }
 
47
 
 
48
        public void Remove (Photo photo) {
 
49
            record.RemoveItem (photo.Id);
 
50
            photos.Remove (photo);
 
51
        }
 
52
    }
 
53
}