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

« back to all changes in this revision

Viewing changes to extensions/PicasaWebExport/google-sharp/PicasaPictureCollection.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.PicasaPictureCollection
3
 
//
4
 
// Author:
5
 
//      Gonzalo Paniagua Javier (gonzalo@novell.com)
6
 
//
7
 
 
8
 
//
9
 
// Copyright (C) 2006 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;
33
 
using System.Collections.Specialized;
34
 
 
35
 
namespace Mono.Google.Picasa {
36
 
        public sealed class PicasaPictureCollection : NameObjectCollectionBase {
37
 
                internal PicasaPictureCollection ()
38
 
                {
39
 
                }
40
 
 
41
 
                internal void Add (PicasaPicture picture)
42
 
                {
43
 
                        if (BaseGet (picture.UniqueID) != null)
44
 
                                throw new Exception ("Duplicate picture?");
45
 
 
46
 
                        BaseAdd (picture.UniqueID, picture);
47
 
                }
48
 
 
49
 
                internal void SetReadOnly ()
50
 
                {
51
 
                        IsReadOnly = true;
52
 
                }
53
 
 
54
 
                public PicasaPicture GetByTitle (string title)
55
 
                {
56
 
                        if (title == null)
57
 
                                throw new ArgumentNullException ("id");
58
 
 
59
 
                        int count = Count;
60
 
                        for (int i = 0; i < count; i++) {
61
 
                                if (this [i].Title == title)
62
 
                                        return this [i];
63
 
                        }
64
 
 
65
 
                        return null;
66
 
                }
67
 
 
68
 
                public PicasaPicture this [int index] {
69
 
                        get { return (PicasaPicture) BaseGet (index); }
70
 
                }
71
 
 
72
 
                public PicasaPicture this [string uniqueID] {
73
 
                        get { return (PicasaPicture) BaseGet (uniqueID); }
74
 
                }
75
 
 
76
 
                public string [] AllKeys {
77
 
                        get {
78
 
                                NameObjectCollectionBase.KeysCollection keys = Keys;
79
 
                                int count = keys.Count;
80
 
                                string [] result = new string [count];
81
 
                                for (int i = 0; i < count; i++)
82
 
                                        result [i] = keys [i];
83
 
                                
84
 
                                return result;
85
 
                        }
86
 
                }
87
 
 
88
 
                public PicasaPicture [] AllValues {
89
 
                        get { return (PicasaPicture []) BaseGetAllValues (typeof (PicasaPicture)); }
90
 
                }
91
 
 
92
 
        }
93
 
}
94