The Labs \ Source Viewer \ SSCLI \ System.Xml.Xsl.Qil \ WhitespaceRule

  1. //------------------------------------------------------------------------------
  2. // <copyright file="WhitespaceRule.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. //------------------------------------------------------------------------------
  15. namespace System.Xml.Xsl.Qil
  16. {
  17.     /// <summary>
  18.     /// Data structure for storing whitespace rules generated by xsl:strip-space and xsl:preserve-space
  19.     /// </summary>
  20.     internal class WhitespaceRule
  21.     {
  22.         private string localName;
  23.         private string namespaceName;
  24.         private bool preserveSpace;
  25.        
  26.         /// <summary>
  27.         /// Allow derived classes to construct empty whitespace rule.
  28.         /// </summary>
  29.         protected WhitespaceRule()
  30.         {
  31.         }
  32.        
  33.         /// <summary>
  34.         /// Construct new whitespace rule.
  35.         /// </summary>
  36.         public WhitespaceRule(string localName, string namespaceName, bool preserveSpace)
  37.         {
  38.             Init(localName, namespaceName, preserveSpace);
  39.         }
  40.        
  41.         /// <summary>
  42.         /// Initialize whitespace rule after it's been constructed.
  43.         /// </summary>
  44.         protected void Init(string localName, string namespaceName, bool preserveSpace)
  45.         {
  46.             this.localName = localName;
  47.             this.namespaceName = namespaceName;
  48.             this.preserveSpace = preserveSpace;
  49.         }
  50.        
  51.         /// <summary>
  52.         /// Local name of the element.
  53.         /// </summary>
  54.         public string LocalName {
  55.             get { return localName; }
  56.             set { localName = value; }
  57.         }
  58.        
  59.         /// <summary>
  60.         /// Namespace name (uri) of the element.
  61.         /// </summary>
  62.         public string NamespaceName {
  63.             get { return namespaceName; }
  64.             set { namespaceName = value; }
  65.         }
  66.        
  67.         /// <summary>
  68.         /// True, if this element is whitespace-preserving.
  69.         /// False, if this element is whitespace-stripping.
  70.         /// </summary>
  71.         public bool PreserveSpace {
  72.             get { return preserveSpace; }
  73.         }
  74.     }
  75. }

Developer Fusion