XmlArrayAttribute.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //------------------------------------------------------------------------------
  2. // <copyright file="XmlArrayAttribute.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\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute"]/*' />
  11. /// <devdoc>
  12. /// <para>[To be supplied.]</para>
  13. /// </devdoc>
  14. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple=false)]
  15. public class XmlArrayAttribute : System.Attribute {
  16. string elementName;
  17. string ns;
  18. bool nullable;
  19. XmlSchemaForm form = XmlSchemaForm.None;
  20. int order = -1;
  21. /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.XmlArrayAttribute"]/*' />
  22. /// <devdoc>
  23. /// <para>[To be supplied.]</para>
  24. /// </devdoc>
  25. public XmlArrayAttribute() {
  26. }
  27. /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.XmlArrayAttribute1"]/*' />
  28. /// <devdoc>
  29. /// <para>[To be supplied.]</para>
  30. /// </devdoc>
  31. public XmlArrayAttribute(string elementName) {
  32. this.elementName = elementName;
  33. }
  34. /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.ElementName"]/*' />
  35. /// <devdoc>
  36. /// <para>[To be supplied.]</para>
  37. /// </devdoc>
  38. public string ElementName {
  39. get { return elementName == null ? string.Empty : elementName; }
  40. set { elementName = value; }
  41. }
  42. /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.Namespace"]/*' />
  43. /// <devdoc>
  44. /// <para>[To be supplied.]</para>
  45. /// </devdoc>
  46. public string Namespace {
  47. get { return ns; }
  48. set { ns = value; }
  49. }
  50. /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.IsNullable"]/*' />
  51. /// <devdoc>
  52. /// <para>[To be supplied.]</para>
  53. /// </devdoc>
  54. public bool IsNullable {
  55. get { return nullable; }
  56. set { nullable = value; }
  57. }
  58. /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.Form"]/*' />
  59. /// <devdoc>
  60. /// <para>[To be supplied.]</para>
  61. /// </devdoc>
  62. public XmlSchemaForm Form {
  63. get { return form; }
  64. set { form = value; }
  65. }
  66. /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.Order"]/*' />
  67. /// <devdoc>
  68. /// <para>[To be supplied.]</para>
  69. /// </devdoc>
  70. public int Order {
  71. get { return order; }
  72. set {
  73. if (value < 0)
  74. throw new ArgumentException(Res.GetString(Res.XmlDisallowNegativeValues), "Order");
  75. order = value;
  76. }
  77. }
  78. }
  79. }