XmlAnyElementAttribute.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //------------------------------------------------------------------------------
  2. // <copyright file="XmlAnyElementAttribute.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\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute"]/*' />
  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 XmlAnyElementAttribute : System.Attribute {
  16. string name;
  17. string ns;
  18. int order = -1;
  19. bool nsSpecified = false;
  20. /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.XmlAnyElementAttribute"]/*' />
  21. /// <devdoc>
  22. /// <para>[To be supplied.]</para>
  23. /// </devdoc>
  24. public XmlAnyElementAttribute() {
  25. }
  26. /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.XmlAnyElementAttribute1"]/*' />
  27. /// <devdoc>
  28. /// <para>[To be supplied.]</para>
  29. /// </devdoc>
  30. public XmlAnyElementAttribute(string name) {
  31. this.name = name;
  32. }
  33. /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.XmlAnyElementAttribute2"]/*' />
  34. /// <devdoc>
  35. /// <para>[To be supplied.]</para>
  36. /// </devdoc>
  37. public XmlAnyElementAttribute(string name, string ns) {
  38. this.name = name;
  39. this.ns = ns;
  40. nsSpecified = true;
  41. }
  42. /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.Name"]/*' />
  43. /// <devdoc>
  44. /// <para>[To be supplied.]</para>
  45. /// </devdoc>
  46. public string Name {
  47. get { return name == null ? string.Empty : name; }
  48. set { name = value; }
  49. }
  50. /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.Namespace"]/*' />
  51. /// <devdoc>
  52. /// <para>[To be supplied.]</para>
  53. /// </devdoc>
  54. public string Namespace {
  55. get { return ns; }
  56. set {
  57. ns = value;
  58. nsSpecified = true;
  59. }
  60. }
  61. /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.Order"]/*' />
  62. /// <devdoc>
  63. /// <para>[To be supplied.]</para>
  64. /// </devdoc>
  65. public int Order {
  66. get { return order; }
  67. set {
  68. if (value < 0)
  69. throw new ArgumentException(Res.GetString(Res.XmlDisallowNegativeValues), "Order");
  70. order = value;
  71. }
  72. }
  73. internal bool NamespaceSpecified {
  74. get { return nsSpecified; }
  75. }
  76. }
  77. }