XmlSerializerTestClasses.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // System.Xml.XmlSerializerTestClasses
  3. //
  4. // Author:
  5. // Erik LeBel <[email protected]>
  6. //
  7. // (C) 2003 Erik LeBel
  8. //
  9. // Classes to use in the testing of the XmlSerializer
  10. //
  11. using System;
  12. using System.Collections;
  13. using System.Xml.Serialization;
  14. namespace MonoTests.System.Xml.TestClasses
  15. {
  16. public enum SimpleEnumeration { FIRST, SECOND };
  17. public class SimpleClass
  18. {
  19. public string something = null;
  20. }
  21. public class StringCollection : CollectionBase
  22. {
  23. public void Add (String parameter)
  24. {
  25. List.Insert (Count, parameter);
  26. }
  27. public String this [int index]
  28. {
  29. get
  30. {
  31. if (index < 0 || index > Count)
  32. throw new ArgumentOutOfRangeException ();
  33. return (String) List [index];
  34. }
  35. set { List [index] = value; }
  36. }
  37. }
  38. public class StringCollectionContainer
  39. {
  40. StringCollection messages = new StringCollection();
  41. public StringCollection Messages
  42. {
  43. get { return messages; }
  44. }
  45. }
  46. public class ArrayContainer
  47. {
  48. public object [] items = null;
  49. }
  50. public class ClassArrayContainer
  51. {
  52. public SimpleClass [] items = null;
  53. }
  54. [XmlRoot("simple")]
  55. public class SimpleClassWithXmlAttributes
  56. {
  57. [XmlAttribute("member")]
  58. public string something = null;
  59. }
  60. }