~ubuntu-branches/debian/squeeze/f-spot/squeeze

« back to all changes in this revision

Viewing changes to extensions/Exporters/PicasaWebExport/google-sharp/PicasaAlbumCollection.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane, Mirco Bauer, Iain Lane
  • Date: 2009-02-07 20:23:32 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20090207202332-oc93rfjo1st0571s
Tags: 0.5.0.3-2
[ Mirco Bauer]
* Upload to unstable.
* debian/control:
  + Lowered GNOME# build-deps to 2.0 ABI as that transition didn't happen
    yet in unstable.

[ Iain Lane ]
* debian/patches/svn-r4545_locales-import.dpatch: Patch backported from SVN
  trunk revision 4545 - initialize the translation catalog earlier (LP: #293305)
  (Closes: #514457). Thanks to Florian Heinle for finding the patch and to
  Chris Coulson for preparing the update.
* debian/control: Build-depend on libmono-dev (>= 1.2.4) to match configure
  checks.
* debian/rules: Pass CSC=/usr/bin/csc to configure for gio-sharp to fix FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// Mono.Google.Picasa.PicasaAlbumCollection
 
3
//
 
4
// Author:
 
5
//      Gonzalo Paniagua Javier (gonzalo@novell.com)
 
6
//
 
7
 
 
8
//
 
9
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
 
10
//
 
11
// Permission is hereby granted, free of charge, to any person obtaining
 
12
// a copy of this software and associated documentation files (the
 
13
// "Software"), to deal in the Software without restriction, including
 
14
// without limitation the rights to use, copy, modify, merge, publish,
 
15
// distribute, sublicense, and/or sell copies of the Software, and to
 
16
// permit persons to whom the Software is furnished to do so, subject to
 
17
// the following conditions:
 
18
//
 
19
// The above copyright notice and this permission notice shall be
 
20
// included in all copies or substantial portions of the Software.
 
21
//
 
22
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
23
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
24
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
25
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 
26
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 
27
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 
28
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
29
//
 
30
 
 
31
using System;
 
32
using System.Collections.Specialized;
 
33
 
 
34
namespace Mono.Google.Picasa {
 
35
        public sealed class PicasaAlbumCollection : NameObjectCollectionBase {
 
36
                internal PicasaAlbumCollection ()
 
37
                {
 
38
                }
 
39
 
 
40
                internal void Add (PicasaAlbum album)
 
41
                {
 
42
                        if (BaseGet (album.UniqueID) != null)
 
43
                                throw new Exception ("Duplicate album?");
 
44
 
 
45
                        BaseAdd (album.UniqueID, album);
 
46
                }
 
47
 
 
48
                internal void SetReadOnly ()
 
49
                {
 
50
                        IsReadOnly = true;
 
51
                }
 
52
 
 
53
                public PicasaAlbum GetByTitle (string title)
 
54
                {
 
55
                        if (title == null)
 
56
                                throw new ArgumentNullException ("id");
 
57
 
 
58
                        int count = Count;
 
59
                        for (int i = 0; i < count; i++) {
 
60
                                if (this [i].Title == title)
 
61
                                        return this [i];
 
62
                        }
 
63
 
 
64
                        return null;
 
65
                }
 
66
 
 
67
                public PicasaAlbum this [int index] {
 
68
                        get { return (PicasaAlbum) BaseGet (index); }
 
69
                }
 
70
 
 
71
                public PicasaAlbum this [string uniqueID] {
 
72
                        get { return (PicasaAlbum) BaseGet (uniqueID); }
 
73
                }
 
74
 
 
75
                public string [] AllKeys {
 
76
                        get {
 
77
                                NameObjectCollectionBase.KeysCollection keys = Keys;
 
78
                                int count = keys.Count;
 
79
                                string [] result = new string [count];
 
80
                                for (int i = 0; i < count; i++)
 
81
                                        result [i] = keys [i];
 
82
 
 
83
                                return result;
 
84
                        }
 
85
                }
 
86
 
 
87
                public PicasaAlbum [] AllValues {
 
88
                        get { return (PicasaAlbum []) BaseGetAllValues (typeof (PicasaAlbum)); }
 
89
                }
 
90
        }
 
91
}