예제 #1
0
        internal override IProducerConsumer CreatePullChain(TextReader input, ConverterReader converterReader)
        {
            this.inputEncoding  = Encoding.Unicode;
            this.outputEncoding = Encoding.Unicode;
            ConverterInput  input2 = new ConverterUnicodeInput(input, false, this.maxHtmlTagSize, base.TestBoundaryConditions, converterReader);
            ConverterOutput output = new ConverterUnicodeOutput(converterReader, false, false);

            return(this.CreateChain(input2, output, converterReader));
        }
예제 #2
0
        internal override IProducerConsumer CreatePullChain(Stream input, ConverterReader converterReader)
        {
            if (this.inputEncoding == null)
            {
                throw new InvalidOperationException(TextConvertersStrings.InputEncodingRequired);
            }
            this.outputEncoding = Encoding.Unicode;
            ConverterInput  input2 = new ConverterDecodingInput(input, false, this.inputEncoding, this.detectEncodingFromByteOrderMark, this.maxHtmlTagSize, this.testMaxHtmlRestartOffset, base.InputStreamBufferSize, base.TestBoundaryConditions, this, converterReader);
            ConverterOutput output = new ConverterUnicodeOutput(converterReader, false, true);

            return(this.CreateChain(input2, output, converterReader));
        }
 /// <summary>
 /// Releases the unmanaged resources used by the <see cref="T:System.IO.TextReader" /> and optionally releases the managed resources.
 /// </summary>
 /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing && source != null)
     {
         if (source is Stream)
         {
             ((Stream)source).Close();
         }
         else
         {
             ((TextReader)source).Close();
         }
     }
     if (producer != null && producer is IDisposable)
     {
         ((IDisposable)producer).Dispose();
     }
     source             = null;
     producer           = null;
     sourceOutputObject = null;
     writeBuffer        = null;
     base.Dispose(disposing);
 }
 /// <summary>
 /// Sets the data source for conversion.
 /// </summary>
 /// <param name="converterUnicodeOutputSource">The data source for conversion.</param>
 internal void SetSource(ConverterUnicodeOutput converterUnicodeOutputSource)
 {
     sourceOutputObject = converterUnicodeOutputSource;
 }