2
0

XmlElementAttribute.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // XmlElementAttribute.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 XmlElementAttribute.
  15. /// </summary
  16. [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
  17. | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple=true)]
  18. public class XmlElementAttribute : Attribute
  19. {
  20. private string dataType;
  21. private string elementName;
  22. private XmlSchemaForm form;
  23. private string ns;
  24. private bool isNullable;
  25. private Type type;
  26. private int order;
  27. public XmlElementAttribute ()
  28. {
  29. }
  30. public XmlElementAttribute (string elementName)
  31. {
  32. ElementName = elementName;
  33. }
  34. public XmlElementAttribute (Type type)
  35. {
  36. Type = type;
  37. }
  38. public XmlElementAttribute (string elementName, Type type)
  39. {
  40. ElementName = elementName;
  41. Type = type;
  42. }
  43. public string DataType {
  44. get {
  45. return dataType;
  46. }
  47. set {
  48. dataType = value;
  49. }
  50. }
  51. public string ElementName {
  52. get {
  53. return elementName;
  54. }
  55. set {
  56. elementName = value;
  57. }
  58. }
  59. public XmlSchemaForm Form {
  60. get {
  61. return form;
  62. }
  63. set {
  64. form = value;
  65. }
  66. }
  67. public string Namespace {
  68. get {
  69. return ns;
  70. }
  71. set {
  72. ns = value;
  73. }
  74. }
  75. public bool IsNullable {
  76. get {
  77. return isNullable;
  78. }
  79. set {
  80. isNullable = value;
  81. }
  82. }
  83. public Type Type {
  84. get {
  85. return type;
  86. }
  87. set {
  88. type = value;
  89. }
  90. }
  91. /// <summary>
  92. /// Specifies Order in which Memberswill be serialized as Elements.
  93. /// </summary>
  94. internal int Order
  95. {
  96. get{ return order; }
  97. set{ order = value; }
  98. }
  99. }
  100. }