The Labs \ Source Viewer \ SSCLI \ System.Xml.Schema \ XmlSchemaObject

  1. //------------------------------------------------------------------------------
  2. // <copyright file="XmlSchemaObject.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">priyal</owner>
  15. //------------------------------------------------------------------------------
  16. namespace System.Xml.Schema
  17. {
  18.    
  19.     using System.Diagnostics;
  20.     using System.Xml.Serialization;
  21.     using System.Security.Permissions;
  22.    
  23.     /// <include file='doc\XmlSchemaObject.uex' path='docs/doc[@for="XmlSchemaObject"]/*' />
  24.     /// <devdoc>
  25.     /// <para>[To be supplied.]</para>
  26.     /// </devdoc>
  27.     [PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
  28.     public abstract class XmlSchemaObject
  29.     {
  30.         int lineNum = 0;
  31.         int linePos = 0;
  32.         string sourceUri;
  33.         XmlSerializerNamespaces namespaces;
  34.         XmlSchemaObject parent;
  35.        
  36.         //internal
  37.         bool isProcessing;
  38.         //Indicates whether this object is currently being processed
  39.         /// <include file='doc\XmlSchemaObject.uex' path='docs/doc[@for="XmlSchemaObject.LineNum"]/*' />
  40.         /// <devdoc>
  41.         /// <para>[To be supplied.]</para>
  42.         /// </devdoc>
  43.         [XmlIgnore()]
  44.         public int LineNumber {
  45.             get { return lineNum; }
  46.             set { lineNum = value; }
  47.         }
  48.        
  49.         /// <include file='doc\XmlSchemaObject.uex' path='docs/doc[@for="XmlSchemaObject.LinePos"]/*' />
  50.         /// <devdoc>
  51.         /// <para>[To be supplied.]</para>
  52.         /// </devdoc>
  53.         [XmlIgnore()]
  54.         public int LinePosition {
  55.             get { return linePos; }
  56.             set { linePos = value; }
  57.         }
  58.        
  59.         /// <include file='doc\XmlSchemaObject.uex' path='docs/doc[@for="XmlSchemaObject.SourceUri"]/*' />
  60.         /// <devdoc>
  61.         /// <para>[To be supplied.]</para>
  62.         /// </devdoc>
  63.         [XmlIgnore()]
  64.         public string SourceUri {
  65.             get { return sourceUri; }
  66.             set { sourceUri = value; }
  67.         }
  68.        
  69.         /// <include file='doc\XmlSchemaObject.uex' path='docs/doc[@for="XmlSchemaObject.Parent"]/*' />
  70.         [XmlIgnore()]
  71.         public XmlSchemaObject Parent {
  72.             get { return parent; }
  73.             set { parent = value; }
  74.         }
  75.        
  76.         /// <include file='doc\XmlSchemaObject.uex' path='docs/doc[@for="XmlSchemaObject.Namespaces"]/*' />
  77.         [XmlNamespaceDeclarations()]
  78.         public XmlSerializerNamespaces Namespaces {
  79.             get {
  80.                 if (namespaces == null)
  81.                     namespaces = new XmlSerializerNamespaces();
  82.                 return namespaces;
  83.             }
  84.             set { namespaces = value; }
  85.         }
  86.        
  87.         internal virtual void OnAdd(XmlSchemaObjectCollection container, object item)
  88.         {
  89.         }
  90.         internal virtual void OnRemove(XmlSchemaObjectCollection container, object item)
  91.         {
  92.         }
  93.         internal virtual void OnClear(XmlSchemaObjectCollection container)
  94.         {
  95.         }
  96.        
  97.         [XmlIgnore()]
  98.         internal virtual string IdAttribute {
  99.             get {
  100.                 Debug.Assert(false);
  101.                 return null;
  102.             }
  103.             set { Debug.Assert(false); }
  104.         }
  105.        
  106.         internal virtual void SetUnhandledAttributes(XmlAttribute[] moreAttributes)
  107.         {
  108.         }
  109.         internal virtual void AddAnnotation(XmlSchemaAnnotation annotation)
  110.         {
  111.         }
  112.        
  113.         [XmlIgnore()]
  114.         internal virtual string NameAttribute {
  115.             get {
  116.                 Debug.Assert(false);
  117.                 return null;
  118.             }
  119.             set { Debug.Assert(false); }
  120.         }
  121.        
  122.         [XmlIgnore()]
  123.         internal bool IsProcessing {
  124.             get { return isProcessing; }
  125.             set { isProcessing = value; }
  126.         }
  127.        
  128.         internal virtual XmlSchemaObject Clone()
  129.         {
  130.             return (XmlSchemaObject)MemberwiseClone();
  131.         }
  132.     }
  133. }

Developer Fusion