The Labs \ Source Viewer \ SSCLI \ System.Xml.Serialization \ XmlArrayAttribute

  1. //------------------------------------------------------------------------------
  2. // <copyright file="XmlArrayAttribute.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. // <owner current="true" primary="true">ElenaK</owner>
  15. //------------------------------------------------------------------------------
  16. namespace System.Xml.Serialization
  17. {
  18.    
  19.     using System;
  20.     using System.Xml.Schema;
  21.    
  22.     /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute"]/*' />
  23.     /// <devdoc>
  24.     /// <para>[To be supplied.]</para>
  25.     /// </devdoc>
  26.     [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false)]
  27.     public class XmlArrayAttribute : System.Attribute
  28.     {
  29.         string elementName;
  30.         string ns;
  31.         bool nullable;
  32.         XmlSchemaForm form = XmlSchemaForm.None;
  33.         int order = -1;
  34.        
  35.         /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.XmlArrayAttribute"]/*' />
  36.         /// <devdoc>
  37.         /// <para>[To be supplied.]</para>
  38.         /// </devdoc>
  39.         public XmlArrayAttribute()
  40.         {
  41.         }
  42.        
  43.         /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.XmlArrayAttribute1"]/*' />
  44.         /// <devdoc>
  45.         /// <para>[To be supplied.]</para>
  46.         /// </devdoc>
  47.         public XmlArrayAttribute(string elementName)
  48.         {
  49.             this.elementName = elementName;
  50.         }
  51.        
  52.         /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.ElementName"]/*' />
  53.         /// <devdoc>
  54.         /// <para>[To be supplied.]</para>
  55.         /// </devdoc>
  56.         public string ElementName {
  57.             get { return elementName == null ? string.Empty : elementName; }
  58.             set { elementName = value; }
  59.         }
  60.        
  61.         /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.Namespace"]/*' />
  62.         /// <devdoc>
  63.         /// <para>[To be supplied.]</para>
  64.         /// </devdoc>
  65.         public string Namespace {
  66.             get { return ns; }
  67.             set { ns = value; }
  68.         }
  69.        
  70.         /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.IsNullable"]/*' />
  71.         /// <devdoc>
  72.         /// <para>[To be supplied.]</para>
  73.         /// </devdoc>
  74.         public bool IsNullable {
  75.             get { return nullable; }
  76.             set { nullable = value; }
  77.         }
  78.        
  79.         /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.Form"]/*' />
  80.         /// <devdoc>
  81.         /// <para>[To be supplied.]</para>
  82.         /// </devdoc>
  83.         public XmlSchemaForm Form {
  84.             get { return form; }
  85.             set { form = value; }
  86.         }
  87.        
  88.         /// <include file='doc\XmlArrayAttribute.uex' path='docs/doc[@for="XmlArrayAttribute.Order"]/*' />
  89.         /// <devdoc>
  90.         /// <para>[To be supplied.]</para>
  91.         /// </devdoc>
  92.         public int Order {
  93.             get { return order; }
  94.             set {
  95.                 if (value < 0)
  96.                     throw new ArgumentException(Res.GetString(Res.XmlDisallowNegativeValues), "Order");
  97.                 order = value;
  98.             }
  99.         }
  100.     }
  101. }

Developer Fusion