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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="XmlMemberMapping.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.Reflection;
  20.     using System;
  21.     using System.CodeDom;
  22.     using System.CodeDom.Compiler;
  23.    
  24.     /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping"]/*' />
  25.     /// <internalonly/>
  26.     public class XmlMemberMapping
  27.     {
  28.         MemberMapping mapping;
  29.        
  30.         internal XmlMemberMapping(MemberMapping mapping)
  31.         {
  32.             this.mapping = mapping;
  33.         }
  34.        
  35.         internal MemberMapping Mapping {
  36.             get { return mapping; }
  37.         }
  38.        
  39.         internal Accessor Accessor {
  40.             get { return mapping.Accessor; }
  41.         }
  42.        
  43.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.Any"]/*' />
  44.         public bool Any {
  45.             get { return Accessor.Any; }
  46.         }
  47.        
  48.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.ElementName"]/*' />
  49.         /// <devdoc>
  50.         /// <para>[To be supplied.]</para>
  51.         /// </devdoc>
  52.         public string ElementName {
  53.             get { return Accessor.UnescapeName(Accessor.Name); }
  54.         }
  55.        
  56.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.XsdElementName"]/*' />
  57.         /// <devdoc>
  58.         /// <para>[To be supplied.]</para>
  59.         /// </devdoc>
  60.         public string XsdElementName {
  61.             get { return Accessor.Name; }
  62.         }
  63.        
  64.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.Namespace"]/*' />
  65.         /// <devdoc>
  66.         /// <para>[To be supplied.]</para>
  67.         /// </devdoc>
  68.         public string Namespace {
  69.             get { return Accessor.Namespace; }
  70.         }
  71.        
  72.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.MemberName"]/*' />
  73.         /// <devdoc>
  74.         /// <para>[To be supplied.]</para>
  75.         /// </devdoc>
  76.         public string MemberName {
  77.             get { return mapping.Name; }
  78.         }
  79.        
  80.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.TypeName"]/*' />
  81.         /// <devdoc>
  82.         /// <para>[To be supplied.]</para>
  83.         /// </devdoc>
  84.         public string TypeName {
  85.             get { return Accessor.Mapping != null ? Accessor.Mapping.TypeName : String.Empty; }
  86.         }
  87.        
  88.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.TypeNamespace"]/*' />
  89.         /// <devdoc>
  90.         /// <para>[To be supplied.]</para>
  91.         /// </devdoc>
  92.         public string TypeNamespace {
  93.             get { return Accessor.Mapping != null ? Accessor.Mapping.Namespace : null; }
  94.         }
  95.        
  96.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.TypeFullName"]/*' />
  97.         /// <devdoc>
  98.         /// <para>[To be supplied.]</para>
  99.         /// </devdoc>
  100.         public string TypeFullName {
  101.             get { return mapping.TypeDesc.FullName; }
  102.         }
  103.        
  104.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.CheckSpecified"]/*' />
  105.         /// <devdoc>
  106.         /// <para>[To be supplied.]</para>
  107.         /// </devdoc>
  108.         public bool CheckSpecified {
  109.             get { return mapping.CheckSpecified; }
  110.         }
  111.        
  112.         internal bool IsNullable {
  113.             get { return mapping.IsNeedNullable; }
  114.         }
  115.        
  116.         /// <include file='doc\XmlMemberMapping.uex' path='docs/doc[@for="XmlMemberMapping.GenerateTypeName"]/*' />
  117.         /// <devdoc>
  118.         /// <para>[To be supplied.]</para>
  119.         /// </devdoc>
  120.         public string GenerateTypeName(CodeDomProvider codeProvider)
  121.         {
  122.             return mapping.GetTypeName(codeProvider);
  123.         }
  124.     }
  125. }

Developer Fusion