The Labs \ Source Viewer \ SSCLI \ System.Xml \ TextEncodedRawTextWriter

  1. //------------------------------------------------------------------------------
  2. // <copyright file="TextWriterGenerator.cxx" 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. // WARNING: This file is generated and should not be modified directly. Instead,
  16. // modify TextWriterGenerator.cxx and run gen.bat in the same directory.
  17. // This batch file will execute the following commands:
  18. //
  19. // cl.exe /C /EP /D _UTF8_TEXT_WRITER TextWriterGenerator.cxx > Utf8TextWriter.cs
  20. // cl.exe /C /EP /D _ENCODED_TEXT_WRITER TextWriterGenerator.cxx > EncodedTextWriter.cs
  21. //
  22. // Because these two implementations of TextWriter are so similar, the C++ preprocessor
  23. // is used to generate each implementation from one template file, using macros and ifdefs.
  24. using System;
  25. using System.IO;
  26. using System.Text;
  27. //using System.Xml.Query;
  28. using System.Xml.Schema;
  29. using System.Diagnostics;
  30. using System.Globalization;
  31. namespace System.Xml
  32. {
  33.     // Concrete implementation of XmlRawWriter interface that serializes text events as encoded
  34.     // text. All other non-text events are ignored. The general-purpose TextEncodedRawTextWriter uses the
  35.     // Encoder class to output to any encoding. The TextUtf8RawTextWriter class combined the encoding
  36.     // operation with serialization in order to achieve better performance.
  37.     // </summary>
  38.     internal class TextEncodedRawTextWriter : XmlEncodedRawTextWriter
  39.     {
  40.        
  41.        
  42.         // Construct an instance of this class that outputs text to the TextWriter interface.
  43.         public TextEncodedRawTextWriter(TextWriter writer, XmlWriterSettings settings) : base(writer, settings)
  44.         {
  45.         }
  46.        
  47.        
  48.         // Construct an instance of this class that serializes to a Stream interface.
  49.         public TextEncodedRawTextWriter(Stream stream, Encoding encoding, XmlWriterSettings settings, bool closeOutput) : base(stream, encoding, settings, closeOutput)
  50.         {
  51.         }
  52.        
  53.        
  54.         //
  55.         // XmlRawWriter
  56.         //
  57.         // Ignore Xml declaration
  58.         internal override void WriteXmlDeclaration(XmlStandalone standalone)
  59.         {
  60.         }
  61.         internal override void WriteXmlDeclaration(string xmldecl)
  62.         {
  63.         }
  64.        
  65.         // Ignore DTD
  66.         public override void WriteDocType(string name, string pubid, string sysid, string subset)
  67.         {
  68.         }
  69.        
  70.         // Ignore Elements
  71.         public override void WriteStartElement(string prefix, string localName, string ns)
  72.         {
  73.         }
  74.        
  75.         internal override void WriteEndElement(string prefix, string localName, string ns)
  76.         {
  77.         }
  78.        
  79.         internal override void WriteFullEndElement(string prefix, string localName, string ns)
  80.         {
  81.         }
  82.        
  83.         internal override void StartElementContent()
  84.         {
  85.         }
  86.        
  87.         // Ignore attributes
  88.         public override void WriteStartAttribute(string prefix, string localName, string ns)
  89.         {
  90.             base.inAttributeValue = true;
  91.         }
  92.        
  93.         public override void WriteEndAttribute()
  94.         {
  95.             base.inAttributeValue = false;
  96.         }
  97.        
  98.         // Ignore namespace declarations
  99.         internal override void WriteNamespaceDeclaration(string prefix, string ns)
  100.         {
  101.         }
  102.        
  103.         // Output content of CDATA sections as plain text without escaping
  104.         public override void WriteCData(string text)
  105.         {
  106.             base.WriteRaw(text);
  107.         }
  108.        
  109.         // Ignore comments
  110.         public override void WriteComment(string text)
  111.         {
  112.         }
  113.        
  114.         // Ignore processing instructions
  115.         public override void WriteProcessingInstruction(string name, string text)
  116.         {
  117.         }
  118.        
  119.         // Ignore entities
  120.         public override void WriteEntityRef(string name)
  121.         {
  122.         }
  123.         public override void WriteCharEntity(char ch)
  124.         {
  125.         }
  126.         public override void WriteSurrogateCharEntity(char lowChar, char highChar)
  127.         {
  128.         }
  129.        
  130.         // Output text content without any escaping; ignore attribute values
  131.         public override void WriteWhitespace(string ws)
  132.         {
  133.             if (!base.inAttributeValue) {
  134.                 base.WriteRaw(ws);
  135.             }
  136.         }
  137.        
  138.         // Output text content without any escaping; ignore attribute values
  139.         public override void WriteString(string textBlock)
  140.         {
  141.             if (!base.inAttributeValue) {
  142.                 base.WriteRaw(textBlock);
  143.             }
  144.         }
  145.        
  146.         // Output text content without any escaping; ignore attribute values
  147.         public override void WriteChars(char[] buffer, int index, int count)
  148.         {
  149.             if (!base.inAttributeValue) {
  150.                 base.WriteRaw(buffer, index, count);
  151.             }
  152.         }
  153.        
  154.         // Output text content without any escaping; ignore attribute values
  155.         public override void WriteRaw(char[] buffer, int index, int count)
  156.         {
  157.             if (!base.inAttributeValue) {
  158.                 base.WriteRaw(buffer, index, count);
  159.             }
  160.         }
  161.        
  162.         // Output text content without any escaping; ignore attribute values
  163.         public override void WriteRaw(string data)
  164.         {
  165.             if (!base.inAttributeValue) {
  166.                 base.WriteRaw(data);
  167.             }
  168.         }
  169.     }
  170. }

Developer Fusion