1
// It is automatically generated
4
using System.Xml.Schema;
5
using System.Xml.Serialization;
7
using System.Collections;
8
using System.Globalization;
10
namespace Mono.Addins.Setup
12
internal class AddinSystemConfigurationReader : XmlSerializationReader
14
static readonly System.Reflection.MethodInfo fromBinHexStringMethod = typeof (XmlConvert).GetMethod ("FromBinHexString", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, new Type [] {typeof (string)}, null);
15
static byte [] FromBinHexString (string input)
17
return input == null ? null : (byte []) fromBinHexStringMethod.Invoke (null, new object [] {input});
19
public object ReadRoot_AddinSystemConfiguration ()
21
Reader.MoveToContent();
22
if (Reader.LocalName != "AddinSystemConfiguration" || Reader.NamespaceURI != "")
23
throw CreateUnknownNodeException();
24
return ReadObject_AddinSystemConfiguration (true, true);
27
public Mono.Addins.Setup.AddinSystemConfiguration ReadObject_AddinSystemConfiguration (bool isNullable, bool checkType)
29
Mono.Addins.Setup.AddinSystemConfiguration ob = null;
30
if (isNullable && ReadNull()) return null;
34
System.Xml.XmlQualifiedName t = GetXsiType();
37
else if (t.Name != "AddinSystemConfiguration" || t.Namespace != "")
38
throw CreateUnknownTypeException(t);
41
ob = (Mono.Addins.Setup.AddinSystemConfiguration) Activator.CreateInstance(typeof(Mono.Addins.Setup.AddinSystemConfiguration), true);
43
Reader.MoveToElement();
45
while (Reader.MoveToNextAttribute())
47
if (IsXmlnsAttribute (Reader.Name)) {
54
Reader.MoveToElement ();
55
Reader.MoveToElement();
56
if (Reader.IsEmptyElement) {
61
Reader.ReadStartElement();
62
Reader.MoveToContent();
64
bool b0=false, b1=false, b2=false, b3=false;
66
while (Reader.NodeType != System.Xml.XmlNodeType.EndElement)
68
if (Reader.NodeType == System.Xml.XmlNodeType.Element)
70
if (Reader.LocalName == "AddinPaths" && Reader.NamespaceURI == "" && !b3) {
71
if (((object)ob.@AddinPaths) == null)
72
throw CreateReadOnlyCollectionException ("System.Collections.Specialized.StringCollection");
73
if (Reader.IsEmptyElement) {
77
Reader.ReadStartElement();
78
Reader.MoveToContent();
80
while (Reader.NodeType != System.Xml.XmlNodeType.EndElement)
82
if (Reader.NodeType == System.Xml.XmlNodeType.Element)
84
if (Reader.LocalName == "Addin" && Reader.NamespaceURI == "") {
85
string s5 = Reader.ReadElementString ();
86
if (((object)ob.@AddinPaths) == null)
87
throw CreateReadOnlyCollectionException ("System.Collections.Specialized.StringCollection");
88
ob.@AddinPaths.Add (s5);
91
else UnknownNode (null);
93
else UnknownNode (null);
95
Reader.MoveToContent();
101
else if (Reader.LocalName == "RepositoryIdCount" && Reader.NamespaceURI == "" && !b1) {
103
string s6 = Reader.ReadElementString ();
104
ob.@RepositoryIdCount = Int32.Parse (s6, CultureInfo.InvariantCulture);
106
else if (Reader.LocalName == "DisabledAddins" && Reader.NamespaceURI == "" && !b2) {
107
if (((object)ob.@DisabledAddins) == null)
108
throw CreateReadOnlyCollectionException ("System.Collections.Specialized.StringCollection");
109
if (Reader.IsEmptyElement) {
113
Reader.ReadStartElement();
114
Reader.MoveToContent();
116
while (Reader.NodeType != System.Xml.XmlNodeType.EndElement)
118
if (Reader.NodeType == System.Xml.XmlNodeType.Element)
120
if (Reader.LocalName == "Addin" && Reader.NamespaceURI == "") {
121
string s8 = Reader.ReadElementString ();
122
if (((object)ob.@DisabledAddins) == null)
123
throw CreateReadOnlyCollectionException ("System.Collections.Specialized.StringCollection");
124
ob.@DisabledAddins.Add (s8);
127
else UnknownNode (null);
129
else UnknownNode (null);
131
Reader.MoveToContent();
137
else if (Reader.LocalName == "Repositories" && Reader.NamespaceURI == "" && !b0) {
138
if (((object)ob.@Repositories) == null)
139
throw CreateReadOnlyCollectionException ("System.Collections.ArrayList");
140
if (Reader.IsEmptyElement) {
144
Reader.ReadStartElement();
145
Reader.MoveToContent();
147
while (Reader.NodeType != System.Xml.XmlNodeType.EndElement)
149
if (Reader.NodeType == System.Xml.XmlNodeType.Element)
151
if (Reader.LocalName == "Repository" && Reader.NamespaceURI == "") {
152
if (((object)ob.@Repositories) == null)
153
throw CreateReadOnlyCollectionException ("System.Collections.ArrayList");
154
ob.@Repositories.Add (ReadObject_RepositoryRecord (false, true));
157
else UnknownNode (null);
159
else UnknownNode (null);
161
Reader.MoveToContent();
174
Reader.MoveToContent();
182
public Mono.Addins.Setup.RepositoryRecord ReadObject_RepositoryRecord (bool isNullable, bool checkType)
184
Mono.Addins.Setup.RepositoryRecord ob = null;
185
if (isNullable && ReadNull()) return null;
189
System.Xml.XmlQualifiedName t = GetXsiType();
192
else if (t.Name != "RepositoryRecord" || t.Namespace != "")
193
throw CreateUnknownTypeException(t);
196
ob = (Mono.Addins.Setup.RepositoryRecord) Activator.CreateInstance(typeof(Mono.Addins.Setup.RepositoryRecord), true);
198
Reader.MoveToElement();
200
while (Reader.MoveToNextAttribute())
202
if (Reader.LocalName == "id" && Reader.NamespaceURI == "") {
203
ob.@Id = Reader.Value;
205
else if (IsXmlnsAttribute (Reader.Name)) {
212
Reader.MoveToElement ();
213
Reader.MoveToElement();
214
if (Reader.IsEmptyElement) {
219
Reader.ReadStartElement();
220
Reader.MoveToContent();
222
bool b10=false, b11=false, b12=false, b13=false, b14=false, b15=false;
224
while (Reader.NodeType != System.Xml.XmlNodeType.EndElement)
226
if (Reader.NodeType == System.Xml.XmlNodeType.Element)
228
if (Reader.LocalName == "File" && Reader.NamespaceURI == "" && !b11) {
230
string s16 = Reader.ReadElementString ();
233
else if (Reader.LocalName == "Enabled" && Reader.NamespaceURI == "" && !b15) {
235
string s17 = Reader.ReadElementString ();
236
ob.@Enabled = XmlConvert.ToBoolean (s17);
238
else if (Reader.LocalName == "IsReference" && Reader.NamespaceURI == "" && !b10) {
240
string s18 = Reader.ReadElementString ();
241
ob.@IsReference = XmlConvert.ToBoolean (s18);
243
else if (Reader.LocalName == "Name" && Reader.NamespaceURI == "" && !b13) {
245
string s19 = Reader.ReadElementString ();
248
else if (Reader.LocalName == "Url" && Reader.NamespaceURI == "" && !b12) {
250
string s20 = Reader.ReadElementString ();
253
else if (Reader.LocalName == "LastModified" && Reader.NamespaceURI == "" && !b14) {
255
string s21 = Reader.ReadElementString ();
256
ob.@LastModified = XmlConvert.ToDateTime (s21, XmlDateTimeSerializationMode.RoundtripKind);
265
Reader.MoveToContent();
273
protected override void InitCallbacks ()
277
protected override void InitIDs ()
283
internal class AddinSystemConfigurationWriter : XmlSerializationWriter
285
const string xmlNamespace = "http://www.w3.org/2000/xmlns/";
286
static readonly System.Reflection.MethodInfo toBinHexStringMethod = typeof (XmlConvert).GetMethod ("ToBinHexString", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, new Type [] {typeof (byte [])}, null);
287
static string ToBinHexString (byte [] input)
289
return input == null ? null : (string) toBinHexStringMethod.Invoke (null, new object [] {input});
291
public void WriteRoot_AddinSystemConfiguration (object o)
293
WriteStartDocument ();
294
Mono.Addins.Setup.AddinSystemConfiguration ob = (Mono.Addins.Setup.AddinSystemConfiguration) o;
296
WriteObject_AddinSystemConfiguration (ob, "AddinSystemConfiguration", "", true, false, true);
299
void WriteObject_AddinSystemConfiguration (Mono.Addins.Setup.AddinSystemConfiguration ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
301
if (((object)ob) == null)
304
WriteNullTagLiteral(element, namesp);
308
System.Type type = ob.GetType ();
309
if (type == typeof(Mono.Addins.Setup.AddinSystemConfiguration))
312
throw CreateUnknownTypeException (ob);
315
if (writeWrappingElem) {
316
WriteStartElement (element, namesp, ob);
319
if (needType) WriteXsiType("AddinSystemConfiguration", "");
321
if (ob.@Repositories != null) {
322
WriteStartElement ("Repositories", "", ob.@Repositories);
323
for (int n22 = 0; n22 < ob.@Repositories.Count; n22++) {
324
WriteObject_RepositoryRecord (((Mono.Addins.Setup.RepositoryRecord) ob.@Repositories[n22]), "Repository", "", false, false, true);
326
WriteEndElement (ob.@Repositories);
328
WriteElementString ("RepositoryIdCount", "", ob.@RepositoryIdCount.ToString(CultureInfo.InvariantCulture));
329
if (ob.@DisabledAddins != null) {
330
WriteStartElement ("DisabledAddins", "", ob.@DisabledAddins);
331
for (int n23 = 0; n23 < ob.@DisabledAddins.Count; n23++) {
332
WriteElementString ("Addin", "", ob.@DisabledAddins[n23]);
334
WriteEndElement (ob.@DisabledAddins);
336
if (ob.@AddinPaths != null) {
337
WriteStartElement ("AddinPaths", "", ob.@AddinPaths);
338
for (int n24 = 0; n24 < ob.@AddinPaths.Count; n24++) {
339
WriteElementString ("Addin", "", ob.@AddinPaths[n24]);
341
WriteEndElement (ob.@AddinPaths);
343
if (writeWrappingElem) WriteEndElement (ob);
346
void WriteObject_RepositoryRecord (Mono.Addins.Setup.RepositoryRecord ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
348
if (((object)ob) == null)
351
WriteNullTagLiteral(element, namesp);
355
System.Type type = ob.GetType ();
356
if (type == typeof(Mono.Addins.Setup.RepositoryRecord))
359
throw CreateUnknownTypeException (ob);
362
if (writeWrappingElem) {
363
WriteStartElement (element, namesp, ob);
366
if (needType) WriteXsiType("RepositoryRecord", "");
368
WriteAttribute ("id", "", ob.@Id);
370
WriteElementString ("IsReference", "", (ob.@IsReference?"true":"false"));
371
WriteElementString ("File", "", ob.@File);
372
WriteElementString ("Url", "", ob.@Url);
373
WriteElementString ("Name", "", ob.@Name);
374
WriteElementString ("LastModified", "", XmlConvert.ToString (ob.@LastModified, XmlDateTimeSerializationMode.RoundtripKind));
375
if (ob.@Enabled != true) {
376
WriteElementString ("Enabled", "", (ob.@Enabled?"true":"false"));
378
if (writeWrappingElem) WriteEndElement (ob);
381
protected override void InitCallbacks ()