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

« back to all changes in this revision

Viewing changes to lib/mono-addins/Mono.Addins.Setup/Mono.Addins.Setup/AddinSystemConfigurationReaderWriter.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2010-05-17 11:59:58 UTC
  • mfrom: (2.4.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100517115958-rplbws9ddda5ikcp
* New upstream release 0.6.2:
 + Stable release before starting large cleanup refactorings, mostly 
   usability, bug fixes and translations as well as some modernization.
   A large part of this comes from the Ubuntu one hundred papercuts effort.
 + Replaced the old slow slideshow code with new fast SlideShow
   (Gabriel Burt)
 + Wording changes for clarity (Edit Tag) (Jeffrey Finkelstein)
 + Fix version selection tooltip (Lorenzo Milesi)
 + Add gconf schema (Jeffrey Stedfast)
 + Added a border to filmstrip thumbnails (Matt Perry) (LP: #513036)
 + Fix display names of color profiles (Pascal de Bruijn)
 + Fix histogram colors on theme change (Paul Wellner Bou)
 + Always update ImageView adjustments when scaling.
   (Wojciech Dzierżanowski)
 + Correctly set attributes on copying (Yann Leprince)
 + Correct mnemonics in create tag dialog (Yves Kurz)
 + Provide sane defaults for image resize size (Yves Kurz)
 + Updates to the build system, including fixes for distcheck
   (Ruben Vermeersch)
 + Fix wording for duplicate hashing (Matt Perry)
 + Fix wording for imported tags tag (Ian Churcher)
 + Fix label alignment in preferences dialog (Pascal de Bruijn)
 + Add unique# and use it to handle our activation (Stephane Delcroix)
 + Stop bundling Mono.Addins (Stephane Delcroix)
 + Avoid leakage in straighten and softfocus editor (Stephane Delcroix)
 + Allow to copy files to clipboard (Stephane Delcroix)
 + Large number of color management related fixes (Stephane Delcroix)
 + Removed the Beagle plugin at the request of the openSUSE team
   (Ruben Vermeersch)
 + A pile of other cleanups and fixes (Ruben Vermeersch)
   - Including '"Import tags" category sounds like an action' (LP: #488784)
 + Two performance improvement patches for our database interaction
   (Michal Nánási)
 + Fix the longstanding issue of F-Spot changing photo timestamps
   (Paul Wellner Bou) (Closes: #445511) (LP: #175191)
 + Tons of translation updates (seriously)
* debian/control, debian/rules: Drop gnome-screensaver build-dep and set
  variables at configure time. Should reduce the BD chain significantly. 
* debian/control: Increase minimum version on libgphoto2-dev BD in line with
  configure requirements.
* debian/control: Add build-dependency on libunique-dev to build new
  unique-sharp bindings which f-spot now uses to handle activation.
* debian/patches/debian_link-system-mono-addins.patch: Drop, now upstream 
* debian/patches/*: Refresh to apply to new upstream version 
* debian/rules: Pass include directories to autoreconf to have the correct
  macros in scope for the new build system 
* debian/patches/ubuntu*: Steal patches from Ubuntu package to improve
  --view mode and add an undo/redo stack. Rebase on new upstream version.
  Thanks to Chris Halse Rogers.
* debian/patches/ubuntu_fname_quote_percent.patch: Drop, now upstream.
* debian/patches/git_transition_duration.patch: Cherrypick patch from
  upstream to reduce the transition duration when entering fullscreen to
  600ms. 
* debian/rules: Incorporate Ubuntu specific changes, and guard by a call to
  dpkg-vendor.
* debian/rules: Don't try to install the gconf schemas when building 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// AddinSystemConfigurationReader.cs
3
 
//
4
 
// Author:
5
 
//   Lluis Sanchez Gual
6
 
//
7
 
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
8
 
//
9
 
// Permission is hereby granted, free of charge, to any person obtaining
10
 
// a copy of this software and associated documentation files (the
11
 
// "Software"), to deal in the Software without restriction, including
12
 
// without limitation the rights to use, copy, modify, merge, publish,
13
 
// distribute, sublicense, and/or sell copies of the Software, and to
14
 
// permit persons to whom the Software is furnished to do so, subject to
15
 
// the following conditions:
16
 
// 
17
 
// The above copyright notice and this permission notice shall be
18
 
// included in all copies or substantial portions of the Software.
19
 
// 
20
 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
 
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22
 
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23
 
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24
 
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25
 
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26
 
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
 
//
28
 
 
29
 
using System;
30
 
using System.Xml;
31
 
using System.Xml.Schema;
32
 
using System.Xml.Serialization;
33
 
using System.Text;
34
 
using System.Collections;
35
 
using System.Globalization;
36
 
 
37
 
namespace Mono.Addins.Setup
38
 
{
39
 
        internal class AddinSystemConfigurationReader : XmlSerializationReader
40
 
        {
41
 
                public object ReadRoot_AddinSystemConfiguration ()
42
 
                {
43
 
                        Reader.MoveToContent();
44
 
                        if (Reader.LocalName != "AddinSystemConfiguration" || Reader.NamespaceURI != "")
45
 
                                throw CreateUnknownNodeException();
46
 
                        return ReadObject_AddinSystemConfiguration (true, true);
47
 
                }
48
 
 
49
 
                public Mono.Addins.Setup.AddinSystemConfiguration ReadObject_AddinSystemConfiguration (bool isNullable, bool checkType)
50
 
                {
51
 
                        Mono.Addins.Setup.AddinSystemConfiguration ob = null;
52
 
                        if (isNullable && ReadNull()) return null;
53
 
 
54
 
                        if (checkType) 
55
 
                        {
56
 
                                System.Xml.XmlQualifiedName t = GetXsiType();
57
 
                                if (t == null)
58
 
                                { }
59
 
                                else if (t.Name != "AddinSystemConfiguration" || t.Namespace != "")
60
 
                                        throw CreateUnknownTypeException(t);
61
 
                        }
62
 
 
63
 
                        ob = new Mono.Addins.Setup.AddinSystemConfiguration ();
64
 
 
65
 
                        Reader.MoveToElement();
66
 
 
67
 
                        while (Reader.MoveToNextAttribute())
68
 
                        {
69
 
                                if (IsXmlnsAttribute (Reader.Name)) {
70
 
                                }
71
 
                                else {
72
 
                                        UnknownNode (ob);
73
 
                                }
74
 
                        }
75
 
 
76
 
                        Reader.MoveToElement();
77
 
                        if (Reader.IsEmptyElement) {
78
 
                                Reader.Skip ();
79
 
                                return ob;
80
 
                        }
81
 
 
82
 
                        Reader.ReadStartElement();
83
 
                        Reader.MoveToContent();
84
 
 
85
 
                        bool b0=false, b1=false, b2=false, b3=false;
86
 
 
87
 
                        while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
88
 
                        {
89
 
                                if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
90
 
                                {
91
 
                                        if (Reader.LocalName == "AddinPaths" && Reader.NamespaceURI == "" && !b3) {
92
 
                                                if (((object)ob.@AddinPaths) == null)
93
 
                                                        throw CreateReadOnlyCollectionException ("System.Collections.Specialized.StringCollection");
94
 
                                                if (Reader.IsEmptyElement) {
95
 
                                                        Reader.Skip();
96
 
                                                } else {
97
 
                                                        int n4 = 0;
98
 
                                                        Reader.ReadStartElement();
99
 
                                                        Reader.MoveToContent();
100
 
 
101
 
                                                        while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
102
 
                                                        {
103
 
                                                                if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
104
 
                                                                {
105
 
                                                                        if (Reader.LocalName == "Addin" && Reader.NamespaceURI == "") {
106
 
                                                                                if (((object)ob.@AddinPaths) == null)
107
 
                                                                                        throw CreateReadOnlyCollectionException ("System.Collections.Specialized.StringCollection");
108
 
                                                                                ob.@AddinPaths.Add (Reader.ReadElementString ());
109
 
                                                                                n4++;
110
 
                                                                        }
111
 
                                                                        else UnknownNode (null);
112
 
                                                                }
113
 
                                                                else UnknownNode (null);
114
 
 
115
 
                                                                Reader.MoveToContent();
116
 
                                                        }
117
 
                                                        ReadEndElement();
118
 
                                                }
119
 
                                                b3 = true;
120
 
                                        }
121
 
                                        else if (Reader.LocalName == "RepositoryIdCount" && Reader.NamespaceURI == "" && !b1) {
122
 
                                                b1 = true;
123
 
                                                ob.@RepositoryIdCount = Int32.Parse (Reader.ReadElementString (), CultureInfo.InvariantCulture);
124
 
                                        }
125
 
                                        else if (Reader.LocalName == "DisabledAddins" && Reader.NamespaceURI == "" && !b2) {
126
 
                                                if (((object)ob.@DisabledAddins) == null)
127
 
                                                        throw CreateReadOnlyCollectionException ("System.Collections.Specialized.StringCollection");
128
 
                                                if (Reader.IsEmptyElement) {
129
 
                                                        Reader.Skip();
130
 
                                                } else {
131
 
                                                        int n5 = 0;
132
 
                                                        Reader.ReadStartElement();
133
 
                                                        Reader.MoveToContent();
134
 
 
135
 
                                                        while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
136
 
                                                        {
137
 
                                                                if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
138
 
                                                                {
139
 
                                                                        if (Reader.LocalName == "Addin" && Reader.NamespaceURI == "") {
140
 
                                                                                if (((object)ob.@DisabledAddins) == null)
141
 
                                                                                        throw CreateReadOnlyCollectionException ("System.Collections.Specialized.StringCollection");
142
 
                                                                                ob.@DisabledAddins.Add (Reader.ReadElementString ());
143
 
                                                                                n5++;
144
 
                                                                        }
145
 
                                                                        else UnknownNode (null);
146
 
                                                                }
147
 
                                                                else UnknownNode (null);
148
 
 
149
 
                                                                Reader.MoveToContent();
150
 
                                                        }
151
 
                                                        ReadEndElement();
152
 
                                                }
153
 
                                                b2 = true;
154
 
                                        }
155
 
                                        else if (Reader.LocalName == "Repositories" && Reader.NamespaceURI == "" && !b0) {
156
 
                                                if (((object)ob.@Repositories) == null)
157
 
                                                        throw CreateReadOnlyCollectionException ("System.Collections.ArrayList");
158
 
                                                if (Reader.IsEmptyElement) {
159
 
                                                        Reader.Skip();
160
 
                                                } else {
161
 
                                                        int n6 = 0;
162
 
                                                        Reader.ReadStartElement();
163
 
                                                        Reader.MoveToContent();
164
 
 
165
 
                                                        while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
166
 
                                                        {
167
 
                                                                if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
168
 
                                                                {
169
 
                                                                        if (Reader.LocalName == "Repository" && Reader.NamespaceURI == "") {
170
 
                                                                                if (((object)ob.@Repositories) == null)
171
 
                                                                                        throw CreateReadOnlyCollectionException ("System.Collections.ArrayList");
172
 
                                                                                ob.@Repositories.Add (ReadObject_RepositoryRecord (false, true));
173
 
                                                                                n6++;
174
 
                                                                        }
175
 
                                                                        else UnknownNode (null);
176
 
                                                                }
177
 
                                                                else UnknownNode (null);
178
 
 
179
 
                                                                Reader.MoveToContent();
180
 
                                                        }
181
 
                                                        ReadEndElement();
182
 
                                                }
183
 
                                                b0 = true;
184
 
                                        }
185
 
                                        else {
186
 
                                                UnknownNode (ob);
187
 
                                        }
188
 
                                }
189
 
                                else
190
 
                                        UnknownNode(ob);
191
 
 
192
 
                                Reader.MoveToContent();
193
 
                        }
194
 
 
195
 
                        ReadEndElement();
196
 
 
197
 
                        return ob;
198
 
                }
199
 
 
200
 
                public Mono.Addins.Setup.RepositoryRecord ReadObject_RepositoryRecord (bool isNullable, bool checkType)
201
 
                {
202
 
                        Mono.Addins.Setup.RepositoryRecord ob = null;
203
 
                        if (isNullable && ReadNull()) return null;
204
 
 
205
 
                        if (checkType) 
206
 
                        {
207
 
                                System.Xml.XmlQualifiedName t = GetXsiType();
208
 
                                if (t == null)
209
 
                                { }
210
 
                                else if (t.Name != "RepositoryRecord" || t.Namespace != "")
211
 
                                        throw CreateUnknownTypeException(t);
212
 
                        }
213
 
 
214
 
                        ob = new Mono.Addins.Setup.RepositoryRecord ();
215
 
 
216
 
                        Reader.MoveToElement();
217
 
 
218
 
                        while (Reader.MoveToNextAttribute())
219
 
                        {
220
 
                                if (Reader.LocalName == "id" && Reader.NamespaceURI == "") {
221
 
                                        ob.@Id = Reader.Value;
222
 
                                }
223
 
                                else if (IsXmlnsAttribute (Reader.Name)) {
224
 
                                }
225
 
                                else {
226
 
                                        UnknownNode (ob);
227
 
                                }
228
 
                        }
229
 
 
230
 
                        Reader.MoveToElement();
231
 
                        if (Reader.IsEmptyElement) {
232
 
                                Reader.Skip ();
233
 
                                return ob;
234
 
                        }
235
 
 
236
 
                        Reader.ReadStartElement();
237
 
                        Reader.MoveToContent();
238
 
 
239
 
                        bool b7=false, b8=false, b9=false, b10=false, b11=false;
240
 
 
241
 
                        while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
242
 
                        {
243
 
                                if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
244
 
                                {
245
 
                                        if (Reader.LocalName == "File" && Reader.NamespaceURI == "" && !b8) {
246
 
                                                b8 = true;
247
 
                                                ob.@File = Reader.ReadElementString ();
248
 
                                        }
249
 
                                        else if (Reader.LocalName == "IsReference" && Reader.NamespaceURI == "" && !b7) {
250
 
                                                b7 = true;
251
 
                                                ob.@IsReference = XmlConvert.ToBoolean (Reader.ReadElementString ());
252
 
                                        }
253
 
                                        else if (Reader.LocalName == "Name" && Reader.NamespaceURI == "" && !b10) {
254
 
                                                b10 = true;
255
 
                                                ob.@Name = Reader.ReadElementString ();
256
 
                                        }
257
 
                                        else if (Reader.LocalName == "Url" && Reader.NamespaceURI == "" && !b9) {
258
 
                                                b9 = true;
259
 
                                                ob.@Url = Reader.ReadElementString ();
260
 
                                        }
261
 
                                        else if (Reader.LocalName == "LastModified" && Reader.NamespaceURI == "" && !b11) {
262
 
                                                b11 = true;
263
 
                                                ob.@LastModified = XmlConvert.ToDateTime (Reader.ReadElementString ());
264
 
                                        }
265
 
                                        else {
266
 
                                                UnknownNode (ob);
267
 
                                        }
268
 
                                }
269
 
                                else
270
 
                                        UnknownNode(ob);
271
 
 
272
 
                                Reader.MoveToContent();
273
 
                        }
274
 
 
275
 
                        ReadEndElement();
276
 
 
277
 
                        return ob;
278
 
                }
279
 
 
280
 
                protected override void InitCallbacks ()
281
 
                {
282
 
                }
283
 
 
284
 
                protected override void InitIDs ()
285
 
                {
286
 
                }
287
 
 
288
 
        }
289
 
 
290
 
        internal class AddinSystemConfigurationWriter : XmlSerializationWriter
291
 
        {
292
 
                const string xmlNamespace = "http://www.w3.org/2000/xmlns/";
293
 
                public void WriteRoot_AddinSystemConfiguration (object o)
294
 
                {
295
 
                        WriteStartDocument ();
296
 
                        Mono.Addins.Setup.AddinSystemConfiguration ob = (Mono.Addins.Setup.AddinSystemConfiguration) o;
297
 
                        TopLevelElement ();
298
 
                        WriteObject_AddinSystemConfiguration (ob, "AddinSystemConfiguration", "", true, false, true);
299
 
                }
300
 
 
301
 
                void WriteObject_AddinSystemConfiguration (Mono.Addins.Setup.AddinSystemConfiguration ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
302
 
                {
303
 
                        if (((object)ob) == null)
304
 
                        {
305
 
                                if (isNullable)
306
 
                                        WriteNullTagLiteral(element, namesp);
307
 
                                return;
308
 
                        }
309
 
 
310
 
                        System.Type type = ob.GetType ();
311
 
                        if (type == typeof(Mono.Addins.Setup.AddinSystemConfiguration))
312
 
                        { }
313
 
                        else {
314
 
                                throw CreateUnknownTypeException (ob);
315
 
                        }
316
 
 
317
 
                        if (writeWrappingElem) {
318
 
                                WriteStartElement (element, namesp, ob);
319
 
                        }
320
 
 
321
 
                        if (needType) WriteXsiType("AddinSystemConfiguration", "");
322
 
 
323
 
                        if (ob.@Repositories != null) {
324
 
                                WriteStartElement ("Repositories", "", ob.@Repositories);
325
 
                                for (int n12 = 0; n12 < ob.@Repositories.Count; n12++) {
326
 
                                        WriteObject_RepositoryRecord (((Mono.Addins.Setup.RepositoryRecord) ob.@Repositories[n12]), "Repository", "", false, false, true);
327
 
                                }
328
 
                                WriteEndElement (ob.@Repositories);
329
 
                        }
330
 
                        WriteElementString ("RepositoryIdCount", "", ob.@RepositoryIdCount.ToString(CultureInfo.InvariantCulture));
331
 
                        if (ob.@DisabledAddins != null) {
332
 
                                WriteStartElement ("DisabledAddins", "", ob.@DisabledAddins);
333
 
                                for (int n13 = 0; n13 < ob.@DisabledAddins.Count; n13++) {
334
 
                                        WriteElementString ("Addin", "", ob.@DisabledAddins[n13]);
335
 
                                }
336
 
                                WriteEndElement (ob.@DisabledAddins);
337
 
                        }
338
 
                        if (ob.@AddinPaths != null) {
339
 
                                WriteStartElement ("AddinPaths", "", ob.@AddinPaths);
340
 
                                for (int n14 = 0; n14 < ob.@AddinPaths.Count; n14++) {
341
 
                                        WriteElementString ("Addin", "", ob.@AddinPaths[n14]);
342
 
                                }
343
 
                                WriteEndElement (ob.@AddinPaths);
344
 
                        }
345
 
                        if (writeWrappingElem) WriteEndElement (ob);
346
 
                }
347
 
 
348
 
                void WriteObject_RepositoryRecord (Mono.Addins.Setup.RepositoryRecord ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
349
 
                {
350
 
                        if (((object)ob) == null)
351
 
                        {
352
 
                                if (isNullable)
353
 
                                        WriteNullTagLiteral(element, namesp);
354
 
                                return;
355
 
                        }
356
 
 
357
 
                        System.Type type = ob.GetType ();
358
 
                        if (type == typeof(Mono.Addins.Setup.RepositoryRecord))
359
 
                        { }
360
 
                        else {
361
 
                                throw CreateUnknownTypeException (ob);
362
 
                        }
363
 
 
364
 
                        if (writeWrappingElem) {
365
 
                                WriteStartElement (element, namesp, ob);
366
 
                        }
367
 
 
368
 
                        if (needType) WriteXsiType("RepositoryRecord", "");
369
 
 
370
 
                        WriteAttribute ("id", "", ob.@Id);
371
 
 
372
 
                        WriteElementString ("IsReference", "", (ob.@IsReference?"true":"false"));
373
 
                        WriteElementString ("File", "", ob.@File);
374
 
                        WriteElementString ("Url", "", ob.@Url);
375
 
                        WriteElementString ("Name", "", ob.@Name);
376
 
                        WriteElementString ("LastModified", "", ob.@LastModified.ToString("yyyy-MM-ddTHH:mm:ss.fffffffzzz", CultureInfo.InvariantCulture));
377
 
                        if (writeWrappingElem) WriteEndElement (ob);
378
 
                }
379
 
 
380
 
                protected override void InitCallbacks ()
381
 
                {
382
 
                }
383
 
 
384
 
        }
385
 
 
386
 
}
387