XmlArrayItemAttribute.cs 1.8 KB

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