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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="XmlArrayItemAttribute.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\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute"]/*' />
  23.     /// <devdoc>
  24.     /// <para>[To be supplied.]</para>
  25.     /// </devdoc>
  26.     [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true)]
  27.     public class XmlArrayItemAttribute : System.Attribute
  28.     {
  29.         string elementName;
  30.         Type type;
  31.         string ns;
  32.         string dataType;
  33.         bool nullable;
  34.         bool nullableSpecified = false;
  35.         XmlSchemaForm form = XmlSchemaForm.None;
  36.         int nestingLevel;
  37.        
  38.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.XmlArrayItemAttribute"]/*' />
  39.         /// <devdoc>
  40.         /// <para>[To be supplied.]</para>
  41.         /// </devdoc>
  42.         public XmlArrayItemAttribute()
  43.         {
  44.         }
  45.        
  46.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.XmlArrayItemAttribute1"]/*' />
  47.         /// <devdoc>
  48.         /// <para>[To be supplied.]</para>
  49.         /// </devdoc>
  50.         public XmlArrayItemAttribute(string elementName)
  51.         {
  52.             this.elementName = elementName;
  53.         }
  54.        
  55.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.XmlArrayItemAttribute2"]/*' />
  56.         /// <devdoc>
  57.         /// <para>[To be supplied.]</para>
  58.         /// </devdoc>
  59.         public XmlArrayItemAttribute(Type type)
  60.         {
  61.             this.type = type;
  62.         }
  63.        
  64.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.XmlArrayItemAttribute3"]/*' />
  65.         /// <devdoc>
  66.         /// <para>[To be supplied.]</para>
  67.         /// </devdoc>
  68.         public XmlArrayItemAttribute(string elementName, Type type)
  69.         {
  70.             this.elementName = elementName;
  71.             this.type = type;
  72.         }
  73.        
  74.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.Type"]/*' />
  75.         /// <devdoc>
  76.         /// <para>[To be supplied.]</para>
  77.         /// </devdoc>
  78.         public Type Type {
  79.             get { return type; }
  80.             set { type = value; }
  81.         }
  82.        
  83.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.ElementName"]/*' />
  84.         /// <devdoc>
  85.         /// <para>[To be supplied.]</para>
  86.         /// </devdoc>
  87.         public string ElementName {
  88.             get { return elementName == null ? string.Empty : elementName; }
  89.             set { elementName = value; }
  90.         }
  91.        
  92.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.Namespace"]/*' />
  93.         /// <devdoc>
  94.         /// <para>[To be supplied.]</para>
  95.         /// </devdoc>
  96.         public string Namespace {
  97.             get { return ns; }
  98.             set { ns = value; }
  99.         }
  100.        
  101.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.NestingLevel"]/*' />
  102.         public int NestingLevel {
  103.             get { return nestingLevel; }
  104.             set { nestingLevel = value; }
  105.         }
  106.        
  107.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.DataType"]/*' />
  108.         /// <devdoc>
  109.         /// <para>[To be supplied.]</para>
  110.         /// </devdoc>
  111.         public string DataType {
  112.             get { return dataType == null ? string.Empty : dataType; }
  113.             set { dataType = value; }
  114.         }
  115.        
  116.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.IsNullable"]/*' />
  117.         /// <devdoc>
  118.         /// <para>[To be supplied.]</para>
  119.         /// </devdoc>
  120.         public bool IsNullable {
  121.             get { return nullable; }
  122.             set {
  123.                 nullable = value;
  124.                 nullableSpecified = true;
  125.             }
  126.         }
  127.        
  128.         internal bool IsNullableSpecified {
  129.             get { return nullableSpecified; }
  130.         }
  131.        
  132.         /// <include file='doc\XmlArrayItemAttribute.uex' path='docs/doc[@for="XmlArrayItemAttribute.Form"]/*' />
  133.         /// <devdoc>
  134.         /// <para>[To be supplied.]</para>
  135.         /// </devdoc>
  136.         public XmlSchemaForm Form {
  137.             get { return form; }
  138.             set { form = value; }
  139.         }
  140.     }
  141. }

Developer Fusion