XmlArrayAttribute.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // XmlArrayAttribute.cs:
  3. //
  4. // Author:
  5. // John Donagher ([email protected])
  6. //
  7. // (C) 2002 John Donagher
  8. //
  9. using System.Xml.Schema;
  10. using System;
  11. namespace System.Xml.Serialization
  12. {
  13. /// <summary>
  14. /// Summary description for XmlArrayAttribute.
  15. /// </summary>
  16. [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
  17. | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
  18. public class XmlArrayAttribute : Attribute
  19. {
  20. private string elementName;
  21. private XmlSchemaForm form;
  22. private bool isNullable;
  23. private string ns;
  24. public XmlArrayAttribute()
  25. {
  26. }
  27. public XmlArrayAttribute(string elementName)
  28. {
  29. ElementName = elementName;
  30. }
  31. public string ElementName
  32. {
  33. get
  34. {
  35. return elementName;
  36. }
  37. set
  38. {
  39. elementName = value;
  40. }
  41. }
  42. public XmlSchemaForm Form
  43. {
  44. get
  45. {
  46. return form;
  47. }
  48. set
  49. {
  50. form = value;
  51. }
  52. }
  53. public bool IsNullable
  54. {
  55. get
  56. {
  57. return isNullable;
  58. }
  59. set
  60. {
  61. isNullable = value;
  62. }
  63. }
  64. public string Namespace
  65. {
  66. get
  67. {
  68. return ns;
  69. }
  70. set
  71. {
  72. ns = value;
  73. }
  74. }
  75. internal bool InternalEquals (XmlArrayAttribute other)
  76. {
  77. if (other == null) return false;
  78. return (elementName == other.elementName &&
  79. form == other.form &&
  80. isNullable == other.isNullable &&
  81. ns == other.ns);
  82. }
  83. }
  84. }