XmlArrayItemAttribute.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. //------------------------------------------------------------------------------
  2. // <copyright file="XmlArrayItemAttribute.cs" company="Microsoft">
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. // </copyright>
  5. // <owner current="true" primary="true">Microsoft</owner>
  6. //------------------------------------------------------------------------------
  7. namespace System.Xml.Serialization {
  8. using System;
  9. using System.Xml.Schema;
  10. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute"]/*' />
  11. /// <devdoc>
  12. /// <para>[To be supplied.]</para>
  13. /// </devdoc>
  14. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple=true)]
  15. public class XmlArrayItemAttribute : System.Attribute {
  16. string elementName;
  17. Type type;
  18. string ns;
  19. string dataType;
  20. bool nullable;
  21. bool nullableSpecified = false;
  22. XmlSchemaForm form = XmlSchemaForm.None;
  23. int nestingLevel;
  24. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.XmlArrayItemAttribute"]/*' />
  25. /// <devdoc>
  26. /// <para>[To be supplied.]</para>
  27. /// </devdoc>
  28. public XmlArrayItemAttribute() {
  29. }
  30. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.XmlArrayItemAttribute1"]/*' />
  31. /// <devdoc>
  32. /// <para>[To be supplied.]</para>
  33. /// </devdoc>
  34. public XmlArrayItemAttribute(string elementName) {
  35. this.elementName = elementName;
  36. }
  37. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.XmlArrayItemAttribute2"]/*' />
  38. /// <devdoc>
  39. /// <para>[To be supplied.]</para>
  40. /// </devdoc>
  41. public XmlArrayItemAttribute(Type type) {
  42. this.type = type;
  43. }
  44. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.XmlArrayItemAttribute3"]/*' />
  45. /// <devdoc>
  46. /// <para>[To be supplied.]</para>
  47. /// </devdoc>
  48. public XmlArrayItemAttribute(string elementName, Type type) {
  49. this.elementName = elementName;
  50. this.type = type;
  51. }
  52. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.Type"]/*' />
  53. /// <devdoc>
  54. /// <para>[To be supplied.]</para>
  55. /// </devdoc>
  56. public Type Type {
  57. get { return type; }
  58. set { type = value; }
  59. }
  60. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.ElementName"]/*' />
  61. /// <devdoc>
  62. /// <para>[To be supplied.]</para>
  63. /// </devdoc>
  64. public string ElementName {
  65. get { return elementName == null ? string.Empty : elementName; }
  66. set { elementName = value; }
  67. }
  68. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.Namespace"]/*' />
  69. /// <devdoc>
  70. /// <para>[To be supplied.]</para>
  71. /// </devdoc>
  72. public string Namespace {
  73. get { return ns; }
  74. set { ns = value; }
  75. }
  76. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.NestingLevel"]/*' />
  77. public int NestingLevel {
  78. get { return nestingLevel; }
  79. set { nestingLevel = value; }
  80. }
  81. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.DataType"]/*' />
  82. /// <devdoc>
  83. /// <para>[To be supplied.]</para>
  84. /// </devdoc>
  85. public string DataType {
  86. get { return dataType == null ? string.Empty : dataType; }
  87. set { dataType = value; }
  88. }
  89. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.IsNullable"]/*' />
  90. /// <devdoc>
  91. /// <para>[To be supplied.]</para>
  92. /// </devdoc>
  93. public bool IsNullable {
  94. get { return nullable; }
  95. set { nullable = value; nullableSpecified = true; }
  96. }
  97. internal bool IsNullableSpecified {
  98. get { return nullableSpecified; }
  99. }
  100. /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.Form"]/*' />
  101. /// <devdoc>
  102. /// <para>[To be supplied.]</para>
  103. /// </devdoc>
  104. public XmlSchemaForm Form {
  105. get { return form; }
  106. set { form = value; }
  107. }
  108. }
  109. }