The Labs \ Source Viewer \ SSCLI \ System.Xml.Xsl.XsltOld \ StringOutput

  1. //------------------------------------------------------------------------------
  2. // <copyright file="StringOutput.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.XsltOld
  16. {
  17.     using Res = System.Xml.Utils.Res;
  18.     using System;
  19.     using System.Xml;
  20.     using System.Text;
  21.    
  22.     internal class StringOutput : SequentialOutput
  23.     {
  24.         private StringBuilder builder;
  25.         private string result;
  26.        
  27.         internal string Result {
  28.             get { return this.result; }
  29.         }
  30.        
  31.         internal StringOutput(Processor processor) : base(processor)
  32.         {
  33.             this.builder = new StringBuilder();
  34.         }
  35.        
  36.         internal override void Write(char outputChar)
  37.         {
  38.             this.builder.Append(outputChar);
  39.            
  40.             #if DEBUG
  41.             this.result = this.builder.ToString();
  42.             #endif
  43.         }
  44.        
  45.         internal override void Write(string outputText)
  46.         {
  47.             this.builder.Append(outputText);
  48.            
  49.             #if DEBUG
  50.             this.result = this.builder.ToString();
  51.             #endif
  52.         }
  53.        
  54.         internal override void Close()
  55.         {
  56.             this.result = this.builder.ToString();
  57.         }
  58.     }
  59.    
  60. }

Developer Fusion