aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/Core/Nodes/OptionsNode.cs
diff options
context:
space:
mode:
authoronefang2021-08-26 06:21:19 +1000
committeronefang2021-08-26 06:21:19 +1000
commitcdfbb899f1112dab44d5490838765e9bd73bc60e (patch)
tree52cddd0b76e7ad8544a0ada533f91bb5fc402025 /Prebuild/src/Core/Nodes/OptionsNode.cs
parentStill failing to reconnect for dbCount(), just set the fucking timeout to a y... (diff)
parentDon't strip (OWNER) out of script error report. (diff)
downloadopensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.zip
opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.tar.gz
opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.tar.bz2
opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.tar.xz
Merge branch 'switch' into Domme.
Diffstat (limited to 'Prebuild/src/Core/Nodes/OptionsNode.cs')
-rw-r--r--Prebuild/src/Core/Nodes/OptionsNode.cs1196
1 files changed, 607 insertions, 589 deletions
diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs
index d45bd34..490fd6f 100644
--- a/Prebuild/src/Core/Nodes/OptionsNode.cs
+++ b/Prebuild/src/Core/Nodes/OptionsNode.cs
@@ -5,16 +5,16 @@ Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehea
5Redistribution and use in source and binary forms, with or without modification, are permitted 5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met: 6provided that the following conditions are met:
7 7
8* Redistributions of source code must retain the above copyright notice, this list of conditions 8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer. 9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the 11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution. 12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software 13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission. 14 without specific prior written permission.
15 15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
@@ -34,273 +34,291 @@ using Prebuild.Core.Utilities;
34 34
35namespace Prebuild.Core.Nodes 35namespace Prebuild.Core.Nodes
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// 38 ///
39 /// </summary> 39 /// </summary>
40 [DataNode("Options")] 40 [DataNode("Options")]
41 public class OptionsNode : DataNode 41 public class OptionsNode : DataNode
42 { 42 {
43 #region Fields 43 #region Fields
44 44
45 private static readonly Dictionary<string,FieldInfo> m_OptionFields = new Dictionary<string, FieldInfo>(); 45 private static readonly Dictionary<string,FieldInfo> m_OptionFields = new Dictionary<string, FieldInfo>();
46 46
47 [OptionNode("CompilerDefines")] 47 [OptionNode("CompilerDefines")]
48 private string m_CompilerDefines = ""; 48 private string m_CompilerDefines = "";
49 49
50 /// <summary> 50 /// <summary>
51 /// 51 ///
52 /// </summary> 52 /// </summary>
53 public string CompilerDefines 53 public string CompilerDefines
54 { 54 {
55 get 55 get
56 { 56 {
57 return m_CompilerDefines; 57 return m_CompilerDefines;
58 } 58 }
59 set 59 set
60 { 60 {
61 m_CompilerDefines = value; 61 m_CompilerDefines = value;
62 } 62 }
63 } 63 }
64 64
65 [OptionNode("OptimizeCode")] 65 [OptionNode("OptimizeCode")]
66 private bool m_OptimizeCode; 66 private bool m_OptimizeCode;
67 67
68 /// <summary> 68 /// <summary>
69 /// 69 ///
70 /// </summary> 70 /// </summary>
71 public bool OptimizeCode 71 public bool OptimizeCode
72 { 72 {
73 get 73 get
74 { 74 {
75 return m_OptimizeCode; 75 return m_OptimizeCode;
76 } 76 }
77 set 77 set
78 { 78 {
79 m_OptimizeCode = value; 79 m_OptimizeCode = value;
80 } 80 }
81 } 81 }
82 82
83 [OptionNode("CheckUnderflowOverflow")] 83 [OptionNode("CheckUnderflowOverflow")]
84 private bool m_CheckUnderflowOverflow; 84 private bool m_CheckUnderflowOverflow;
85 85
86 /// <summary> 86 /// <summary>
87 /// 87 ///
88 /// </summary> 88 /// </summary>
89 public bool CheckUnderflowOverflow 89 public bool CheckUnderflowOverflow
90 { 90 {
91 get 91 get
92 { 92 {
93 return m_CheckUnderflowOverflow; 93 return m_CheckUnderflowOverflow;
94 } 94 }
95 set 95 set
96 { 96 {
97 m_CheckUnderflowOverflow = value; 97 m_CheckUnderflowOverflow = value;
98 } 98 }
99 } 99 }
100 100
101 [OptionNode("AllowUnsafe")] 101 [OptionNode("AllowUnsafe")]
102 private bool m_AllowUnsafe; 102 private bool m_AllowUnsafe;
103 103
104 /// <summary> 104 /// <summary>
105 /// 105 ///
106 /// </summary> 106 /// </summary>
107 public bool AllowUnsafe 107 public bool AllowUnsafe
108 { 108 {
109 get 109 get
110 { 110 {
111 return m_AllowUnsafe; 111 return m_AllowUnsafe;
112 } 112 }
113 set 113 set
114 { 114 {
115 m_AllowUnsafe = value; 115 m_AllowUnsafe = value;
116 } 116 }
117 } 117 }
118 118
119 [OptionNode("PreBuildEvent")] 119 [OptionNode("PreBuildEvent")]
120 private string m_PreBuildEvent; 120 private string m_PreBuildEvent;
121 121
122 /// <summary> 122 /// <summary>
123 /// 123 ///
124 /// </summary> 124 /// </summary>
125 public string PreBuildEvent 125 public string PreBuildEvent
126 { 126 {
127 get 127 get
128 { 128 {
129 return m_PreBuildEvent; 129 return m_PreBuildEvent;
130 } 130 }
131 set 131 set
132 { 132 {
133 m_PreBuildEvent = value; 133 m_PreBuildEvent = value;
134 } 134 }
135 } 135 }
136 136
137 [OptionNode("PostBuildEvent")] 137 [OptionNode("PostBuildEvent")]
138 private string m_PostBuildEvent; 138 private string m_PostBuildEvent;
139 139
140 /// <summary> 140 /// <summary>
141 /// 141 ///
142 /// </summary> 142 /// </summary>
143 public string PostBuildEvent 143 public string PostBuildEvent
144 { 144 {
145 get 145 get
146 { 146 {
147 return m_PostBuildEvent; 147 return m_PostBuildEvent;
148 } 148 }
149 set 149 set
150 { 150 {
151 m_PostBuildEvent = value; 151 m_PostBuildEvent = value;
152 } 152 }
153 } 153 }
154 154
155 [OptionNode("PreBuildEventArgs")] 155 [OptionNode("PreBuildEventArgs")]
156 private string m_PreBuildEventArgs; 156 private string m_PreBuildEventArgs;
157 157
158 /// <summary> 158 /// <summary>
159 /// 159 ///
160 /// </summary> 160 /// </summary>
161 public string PreBuildEventArgs 161 public string PreBuildEventArgs
162 { 162 {
163 get 163 get
164 { 164 {
165 return m_PreBuildEventArgs; 165 return m_PreBuildEventArgs;
166 } 166 }
167 set 167 set
168 { 168 {
169 m_PreBuildEventArgs = value; 169 m_PreBuildEventArgs = value;
170 } 170 }
171 } 171 }
172 172
173 [OptionNode("PostBuildEventArgs")] 173 [OptionNode("PostBuildEventArgs")]
174 private string m_PostBuildEventArgs; 174 private string m_PostBuildEventArgs;
175 175
176 /// <summary> 176 /// <summary>
177 /// 177 ///
178 /// </summary> 178 /// </summary>
179 public string PostBuildEventArgs 179 public string PostBuildEventArgs
180 { 180 {
181 get 181 get
182 { 182 {
183 return m_PostBuildEventArgs; 183 return m_PostBuildEventArgs;
184 } 184 }
185 set 185 set
186 { 186 {
187 m_PostBuildEventArgs = value; 187 m_PostBuildEventArgs = value;
188 } 188 }
189 } 189 }
190 190
191 [OptionNode("RunPostBuildEvent")] 191 [OptionNode("RunPostBuildEvent")]
192 private string m_RunPostBuildEvent; 192 private string m_RunPostBuildEvent;
193 193
194 /// <summary> 194 /// <summary>
195 /// 195 ///
196 /// </summary> 196 /// </summary>
197 public string RunPostBuildEvent 197 public string RunPostBuildEvent
198 { 198 {
199 get 199 get
200 { 200 {
201 return m_RunPostBuildEvent; 201 return m_RunPostBuildEvent;
202 } 202 }
203 set 203 set
204 { 204 {
205 m_RunPostBuildEvent = value; 205 m_RunPostBuildEvent = value;
206 } 206 }
207 } 207 }
208 208
209 [OptionNode("RunScript")] 209 [OptionNode("RunScript")]
210 private string m_RunScript; 210 private string m_RunScript;
211 211
212 /// <summary> 212 /// <summary>
213 /// 213 ///
214 /// </summary> 214 /// </summary>
215 public string RunScript 215 public string RunScript
216 { 216 {
217 get 217 get
218 { 218 {
219 return m_RunScript; 219 return m_RunScript;
220 } 220 }
221 set 221 set
222 { 222 {
223 m_RunScript = value; 223 m_RunScript = value;
224 } 224 }
225 } 225 }
226 226
227 [OptionNode("WarningLevel")] 227 [OptionNode("WarningLevel")]
228 private int m_WarningLevel = 4; 228 private int m_WarningLevel = 4;
229 229
230 /// <summary> 230 /// <summary>
231 /// 231 ///
232 /// </summary> 232 /// </summary>
233 public int WarningLevel 233 public int WarningLevel
234 { 234 {
235 get 235 get
236 { 236 {
237 return m_WarningLevel; 237 return m_WarningLevel;
238 } 238 }
239 set 239 set
240 { 240 {
241 m_WarningLevel = value; 241 m_WarningLevel = value;
242 } 242 }
243 } 243 }
244 244
245 [OptionNode("WarningsAsErrors")] 245 [OptionNode("WarningsAsErrors")]
246 private bool m_WarningsAsErrors; 246 private bool m_WarningsAsErrors;
247 247
248 /// <summary> 248 /// <summary>
249 /// 249 ///
250 /// </summary> 250 /// </summary>
251 public bool WarningsAsErrors 251 public bool WarningsAsErrors
252 { 252 {
253 get 253 get
254 { 254 {
255 return m_WarningsAsErrors; 255 return m_WarningsAsErrors;
256 } 256 }
257 set 257 set
258 { 258 {
259 m_WarningsAsErrors = value; 259 m_WarningsAsErrors = value;
260 } 260 }
261 } 261 }
262 262
263 [OptionNode("SuppressWarnings")] 263 [OptionNode("SuppressWarnings")]
264 private string m_SuppressWarnings = ""; 264 private string m_SuppressWarnings = "";
265 265
266 /// <summary> 266 /// <summary>
267 /// 267 ///
268 /// </summary> 268 /// </summary>
269 public string SuppressWarnings 269 public string SuppressWarnings
270 { 270 {
271 get 271 get
272 { 272 {
273 return m_SuppressWarnings; 273 return m_SuppressWarnings;
274 } 274 }
275 set 275 set
276 { 276 {
277 m_SuppressWarnings = value; 277 m_SuppressWarnings = value;
278 } 278 }
279 } 279 }
280 280
281 [OptionNode("OutputPath")] 281 [OptionNode("Prefer32Bit")]
282 private string m_OutputPath = "bin/"; 282 private bool m_Prefer32Bit;
283 283
284 /// <summary> 284 /// <summary>
285 /// 285 ///
286 /// </summary> 286 /// </summary>
287 public string OutputPath 287 public bool Prefer32Bit
288 { 288 {
289 get 289 get
290 { 290 {
291 return m_OutputPath; 291 return m_Prefer32Bit;
292 } 292 }
293 set 293 set
294 { 294 {
295 m_OutputPath = value; 295 m_Prefer32Bit = value;
296 } 296 }
297 } 297 }
298
299 [OptionNode("OutputPath")]
300 private string m_OutputPath = "bin/";
301
302 /// <summary>
303 ///
304 /// </summary>
305 public string OutputPath
306 {
307 get
308 {
309 return m_OutputPath;
310 }
311 set
312 {
313 m_OutputPath = value;
314 }
315 }
298 316
299 [OptionNode("GenerateDocumentation")] 317 [OptionNode("GenerateDocumentation")]
300 private bool m_GenerateDocumentation; 318 private bool m_GenerateDocumentation;
301 319
302 /// <summary> 320 /// <summary>
303 /// 321 ///
304 /// </summary> 322 /// </summary>
305 public bool GenerateDocumentation 323 public bool GenerateDocumentation
306 { 324 {
@@ -314,321 +332,321 @@ namespace Prebuild.Core.Nodes
314 } 332 }
315 } 333 }
316 334
317 [OptionNode("GenerateXmlDocFile")] 335 [OptionNode("GenerateXmlDocFile")]
318 private bool m_GenerateXmlDocFile; 336 private bool m_GenerateXmlDocFile;
319 337
320 /// <summary> 338 /// <summary>
321 /// 339 ///
322 /// </summary> 340 /// </summary>
323 public bool GenerateXmlDocFile 341 public bool GenerateXmlDocFile
324 { 342 {
325 get 343 get
326 { 344 {
327 return m_GenerateXmlDocFile; 345 return m_GenerateXmlDocFile;
328 } 346 }
329 set 347 set
330 { 348 {
331 m_GenerateXmlDocFile = value; 349 m_GenerateXmlDocFile = value;
332 } 350 }
333 } 351 }
334 352
335 [OptionNode("XmlDocFile")] 353 [OptionNode("XmlDocFile")]
336 private string m_XmlDocFile = ""; 354 private string m_XmlDocFile = "";
337 355
338 /// <summary> 356 /// <summary>
339 /// 357 ///
340 /// </summary> 358 /// </summary>
341 public string XmlDocFile 359 public string XmlDocFile
342 { 360 {
343 get 361 get
344 { 362 {
345 return m_XmlDocFile; 363 return m_XmlDocFile;
346 } 364 }
347 set 365 set
348 { 366 {
349 m_XmlDocFile = value; 367 m_XmlDocFile = value;
350 } 368 }
351 } 369 }
352 370
353 [OptionNode("KeyFile")] 371 [OptionNode("KeyFile")]
354 private string m_KeyFile = ""; 372 private string m_KeyFile = "";
355 373
356 /// <summary> 374 /// <summary>
357 /// 375 ///
358 /// </summary> 376 /// </summary>
359 public string KeyFile 377 public string KeyFile
360 { 378 {
361 get 379 get
362 { 380 {
363 return m_KeyFile; 381 return m_KeyFile;
364 } 382 }
365 set 383 set
366 { 384 {
367 m_KeyFile = value; 385 m_KeyFile = value;
368 } 386 }
369 } 387 }
370 388
371 [OptionNode("DebugInformation")] 389 [OptionNode("DebugInformation")]
372 private bool m_DebugInformation; 390 private bool m_DebugInformation;
373 391
374 /// <summary> 392 /// <summary>
375 /// 393 ///
376 /// </summary> 394 /// </summary>
377 public bool DebugInformation 395 public bool DebugInformation
378 { 396 {
379 get 397 get
380 { 398 {
381 return m_DebugInformation; 399 return m_DebugInformation;
382 } 400 }
383 set 401 set
384 { 402 {
385 m_DebugInformation = value; 403 m_DebugInformation = value;
386 } 404 }
387 } 405 }
388 406
389 [OptionNode("RegisterComInterop")] 407 [OptionNode("RegisterComInterop")]
390 private bool m_RegisterComInterop; 408 private bool m_RegisterComInterop;
391 409
392 /// <summary> 410 /// <summary>
393 /// 411 ///
394 /// </summary> 412 /// </summary>
395 public bool RegisterComInterop 413 public bool RegisterComInterop
396 { 414 {
397 get 415 get
398 { 416 {
399 return m_RegisterComInterop; 417 return m_RegisterComInterop;
400 } 418 }
401 set 419 set
402 { 420 {
403 m_RegisterComInterop = value; 421 m_RegisterComInterop = value;
404 } 422 }
405 } 423 }
406 424
407 [OptionNode("RemoveIntegerChecks")] 425 [OptionNode("RemoveIntegerChecks")]
408 private bool m_RemoveIntegerChecks; 426 private bool m_RemoveIntegerChecks;
409 427
410 /// <summary> 428 /// <summary>
411 /// 429 ///
412 /// </summary> 430 /// </summary>
413 public bool RemoveIntegerChecks 431 public bool RemoveIntegerChecks
414 { 432 {
415 get 433 get
416 { 434 {
417 return m_RemoveIntegerChecks; 435 return m_RemoveIntegerChecks;
418 } 436 }
419 set 437 set
420 { 438 {
421 m_RemoveIntegerChecks = value; 439 m_RemoveIntegerChecks = value;
422 } 440 }
423 } 441 }
424 442
425 [OptionNode("IncrementalBuild")] 443 [OptionNode("IncrementalBuild")]
426 private bool m_IncrementalBuild; 444 private bool m_IncrementalBuild;
427 445
428 /// <summary> 446 /// <summary>
429 /// 447 ///
430 /// </summary> 448 /// </summary>
431 public bool IncrementalBuild 449 public bool IncrementalBuild
432 { 450 {
433 get 451 get
434 { 452 {
435 return m_IncrementalBuild; 453 return m_IncrementalBuild;
436 } 454 }
437 set 455 set
438 { 456 {
439 m_IncrementalBuild = value; 457 m_IncrementalBuild = value;
440 } 458 }
441 } 459 }
442 460
443 [OptionNode("BaseAddress")] 461 [OptionNode("BaseAddress")]
444 private string m_BaseAddress = "285212672"; 462 private string m_BaseAddress = "285212672";
445 463
446 /// <summary> 464 /// <summary>
447 /// 465 ///
448 /// </summary> 466 /// </summary>
449 public string BaseAddress 467 public string BaseAddress
450 { 468 {
451 get 469 get
452 { 470 {
453 return m_BaseAddress; 471 return m_BaseAddress;
454 } 472 }
455 set 473 set
456 { 474 {
457 m_BaseAddress = value; 475 m_BaseAddress = value;
458 } 476 }
459 } 477 }
460 478
461 [OptionNode("FileAlignment")] 479 [OptionNode("FileAlignment")]
462 private int m_FileAlignment = 4096; 480 private int m_FileAlignment = 4096;
463 481
464 /// <summary> 482 /// <summary>
465 /// 483 ///
466 /// </summary> 484 /// </summary>
467 public int FileAlignment 485 public int FileAlignment
468 { 486 {
469 get 487 get
470 { 488 {
471 return m_FileAlignment; 489 return m_FileAlignment;
472 } 490 }
473 set 491 set
474 { 492 {
475 m_FileAlignment = value; 493 m_FileAlignment = value;
476 } 494 }
477 } 495 }
478 496
479 [OptionNode("NoStdLib")] 497 [OptionNode("NoStdLib")]
480 private bool m_NoStdLib; 498 private bool m_NoStdLib;
481 499
482 /// <summary> 500 /// <summary>
483 /// 501 ///
484 /// </summary> 502 /// </summary>
485 public bool NoStdLib 503 public bool NoStdLib
486 { 504 {
487 get 505 get
488 { 506 {
489 return m_NoStdLib; 507 return m_NoStdLib;
490 } 508 }
491 set 509 set
492 { 510 {
493 m_NoStdLib = value; 511 m_NoStdLib = value;
494 } 512 }
495 } 513 }
496 514
497 private readonly List<string> m_FieldsDefined = new List<string>(); 515 private readonly List<string> m_FieldsDefined = new List<string>();
498 516
499 #endregion 517 #endregion
500 518
501 #region Constructors 519 #region Constructors
502 520
503 /// <summary> 521 /// <summary>
504 /// Initializes the <see cref="OptionsNode"/> class. 522 /// Initializes the <see cref="OptionsNode"/> class.
505 /// </summary> 523 /// </summary>
506 static OptionsNode() 524 static OptionsNode()
507 { 525 {
508 Type t = typeof(OptionsNode); 526 Type t = typeof(OptionsNode);
509 527
510 foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) 528 foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance))
511 { 529 {
512 object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); 530 object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false);
513 if(attrs == null || attrs.Length < 1) 531 if(attrs == null || attrs.Length < 1)
514 { 532 {
515 continue; 533 continue;
516 } 534 }
517 535
518 OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0]; 536 OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0];
519 m_OptionFields[ona.NodeName] = f; 537 m_OptionFields[ona.NodeName] = f;
520 } 538 }
521 } 539 }
522 540
523 #endregion 541 #endregion
524 542
525 #region Properties 543 #region Properties
526 544
527 /// <summary> 545 /// <summary>
528 /// Gets the <see cref="Object"/> at the specified index. 546 /// Gets the <see cref="Object"/> at the specified index.
529 /// </summary> 547 /// </summary>
530 /// <value></value> 548 /// <value></value>
531 public object this[string index] 549 public object this[string index]
532 { 550 {
533 get 551 get
534 { 552 {
535 if(!m_OptionFields.ContainsKey(index)) 553 if(!m_OptionFields.ContainsKey(index))
536 { 554 {
537 return null; 555 return null;
538 } 556 }
539 557
540 FieldInfo f = m_OptionFields[index]; 558 FieldInfo f = m_OptionFields[index];
541 return f.GetValue(this); 559 return f.GetValue(this);
542 } 560 }
543 } 561 }
544 562
545 /// <summary> 563 /// <summary>
546 /// Gets the <see cref="Object"/> at the specified index. 564 /// Gets the <see cref="Object"/> at the specified index.
547 /// </summary> 565 /// </summary>
548 /// <value></value> 566 /// <value></value>
549 public object this[string index, object defaultValue] 567 public object this[string index, object defaultValue]
550 { 568 {
551 get 569 get
552 { 570 {
553 object valueObject = this[index]; 571 object valueObject = this[index];
554 if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0) 572 if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0)
555 { 573 {
556 return defaultValue; 574 return defaultValue;
557 } 575 }
558 return valueObject; 576 return valueObject;
559 } 577 }
560 } 578 }
561 579
562 580
563 #endregion 581 #endregion
564 582
565 #region Private Methods 583 #region Private Methods
566 584
567 private void FlagDefined(string name) 585 private void FlagDefined(string name)
568 { 586 {
569 if(!m_FieldsDefined.Contains(name)) 587 if(!m_FieldsDefined.Contains(name))
570 { 588 {
571 m_FieldsDefined.Add(name); 589 m_FieldsDefined.Add(name);
572 } 590 }
573 } 591 }
574 592
575 private void SetOption(string nodeName, string val) 593 private void SetOption(string nodeName, string val)
576 { 594 {
577 lock(m_OptionFields) 595 lock(m_OptionFields)
578 { 596 {
579 if(!m_OptionFields.ContainsKey(nodeName)) 597 if(!m_OptionFields.ContainsKey(nodeName))
580 { 598 {
581 return; 599 return;
582 } 600 }
583 601
584 FieldInfo f = m_OptionFields[nodeName]; 602 FieldInfo f = m_OptionFields[nodeName];
585 f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); 603 f.SetValue(this, Helper.TranslateValue(f.FieldType, val));
586 FlagDefined(f.Name); 604 FlagDefined(f.Name);
587 } 605 }
588 } 606 }
589 607
590 #endregion 608 #endregion
591 609
592 #region Public Methods 610 #region Public Methods
593 611
594 /// <summary> 612 /// <summary>
595 /// Parses the specified node. 613 /// Parses the specified node.
596 /// </summary> 614 /// </summary>
597 /// <param name="node">The node.</param> 615 /// <param name="node">The node.</param>
598 public override void Parse(XmlNode node) 616 public override void Parse(XmlNode node)
599 { 617 {
600 if( node == null ) 618 if( node == null )
601 { 619 {
602 throw new ArgumentNullException("node"); 620 throw new ArgumentNullException("node");
603 } 621 }
604 622
605 foreach(XmlNode child in node.ChildNodes) 623 foreach(XmlNode child in node.ChildNodes)
606 { 624 {
607 SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText)); 625 SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText));
608 } 626 }
609 } 627 }
610 628
611 /// <summary> 629 /// <summary>
612 /// Copies to. 630 /// Copies to.
613 /// </summary> 631 /// </summary>
614 /// <param name="opt">The opt.</param> 632 /// <param name="opt">The opt.</param>
615 public void CopyTo(OptionsNode opt) 633 public void CopyTo(OptionsNode opt)
616 { 634 {
617 if(opt == null) 635 if(opt == null)
618 { 636 {
619 return; 637 return;
620 } 638 }
621 639
622 foreach(FieldInfo f in m_OptionFields.Values) 640 foreach(FieldInfo f in m_OptionFields.Values)
623 { 641 {
624 if(m_FieldsDefined.Contains(f.Name)) 642 if(m_FieldsDefined.Contains(f.Name))
625 { 643 {
626 f.SetValue(opt, f.GetValue(this)); 644 f.SetValue(opt, f.GetValue(this));
627 opt.m_FieldsDefined.Add(f.Name); 645 opt.m_FieldsDefined.Add(f.Name);
628 } 646 }
629 } 647 }
630 } 648 }
631 649
632 #endregion 650 #endregion
633 } 651 }
634} 652}