// Token: 0x06000EF9 RID: 3833 RVA: 0x000739DC File Offset: 0x00071BDC
        private IProducerConsumer CreateChain(Stream input, bool push, ConverterOutput output, IProgressMonitor progressMonitor)
        {
            this.locked        = true;
            this.reportBytes   = new ReportBytes(this.expansionSizeLimit, this.expansionSizeMultiple);
            output.ReportBytes = this.reportBytes;
            RtfParser parser;

            if (!this.enableHtmlDeencapsulation)
            {
                parser = new RtfParser(input, push, base.InputStreamBufferSize, this.testBoundaryConditions, push ? null : progressMonitor, this.reportBytes);
                HtmlInjection injection = null;
                if (this.injectHead != null || this.injectTail != null)
                {
                    injection = new HtmlInjection(this.injectHead, this.injectTail, this.injectionFormat, this.filterHtml, this.htmlCallback, this.testBoundaryConditions, null, progressMonitor);
                }
                HtmlWriter   writer  = new HtmlWriter(output, this.filterHtml, !this.testNoNewLines);
                FormatOutput output2 = new HtmlFormatOutput(writer, injection, this.outputFragment, this.testFormatTraceStream, this.testFormatOutputTraceStream, this.filterHtml, this.htmlCallback, true);
                return(new RtfFormatConverter(parser, output2, null, false, this.testTraceStream, this.testTraceShowTokenNum, this.testTraceStopOnTokenNum, this.testFormatConverterTraceStream));
            }
            RtfPreviewStream rtfPreviewStream = input as RtfPreviewStream;

            if (!push && rtfPreviewStream != null && rtfPreviewStream.Parser != null && rtfPreviewStream.InternalPosition == 0 && rtfPreviewStream.InputRtfStream != null)
            {
                rtfPreviewStream.InternalPosition = int.MaxValue;
                parser = new RtfParser(rtfPreviewStream.InputRtfStream, base.InputStreamBufferSize, this.testBoundaryConditions, push ? null : progressMonitor, rtfPreviewStream.Parser, this.reportBytes);
                return(this.CreateChain(rtfPreviewStream.Encapsulation, parser, output, progressMonitor));
            }
            parser = new RtfParser(input, push, base.InputStreamBufferSize, this.testBoundaryConditions, push ? null : progressMonitor, this.reportBytes);
            return(new RtfToHtmlAdapter(parser, output, this, progressMonitor));
        }
Esempio n. 2
0
        private IProducerConsumer CreateChain(ConverterInput input, ConverterOutput output, IProgressMonitor progressMonitor)
        {
            this.locked = true;
            HtmlInjection injection = null;

            if (this.injectHead != null || this.injectTail != null)
            {
                injection = new HtmlInjection(this.injectHead, this.injectTail, this.injectionFormat, this.filterHtml, this.htmlCallback, this.testBoundaryConditions, null, progressMonitor);
            }
            TextParser   parser  = new TextParser(input, this.unwrapFlowed, this.unwrapDelSp, this.testMaxTokenRuns, this.testBoundaryConditions);
            HtmlWriter   writer  = new HtmlWriter(output, this.filterHtml, false);
            FormatOutput output2 = new HtmlFormatOutput(writer, injection, this.outputFragment, this.testFormatTraceStream, this.testFormatOutputTraceStream, this.filterHtml, this.htmlCallback, true);

            return(new TextFormatConverter(parser, output2, null, this.testTraceStream, this.testTraceShowTokenNum, this.testTraceStopOnTokenNum, this.testFormatConverterTraceStream));
        }
Esempio n. 3
0
        private IProducerConsumer CreateChain(ConverterInput input, ConverterOutput output, IProgressMonitor progressMonitor)
        {
            this.locked = true;
            HtmlInjection injection = null;

            if (this.injectHead != null || this.injectTail != null)
            {
                injection = new HtmlInjection(this.injectHead, this.injectTail, this.injectionFormat, this.filterHtml, this.htmlCallback, this.testBoundaryConditions, null, progressMonitor);
            }
            HtmlParser            parser  = new HtmlParser(input, this.detectEncodingFromMetaTag, false, TextConvertersDefaults.MaxTokenRuns(this.testBoundaryConditions), TextConvertersDefaults.MaxHtmlAttributes(this.testBoundaryConditions), this.testBoundaryConditions);
            HtmlNormalizingParser parser2 = new HtmlNormalizingParser(parser, injection, false, TextConvertersDefaults.MaxHtmlNormalizerNesting(this.testBoundaryConditions), this.testBoundaryConditions, this.testNormalizerTraceStream, this.testNormalizerTraceShowTokenNum, this.testNormalizerTraceStopOnTokenNum);
            HtmlWriter            writer  = new HtmlWriter(output, this.filterHtml, true);
            FormatOutput          output2 = new HtmlFormatOutput(writer, null, this.OutputFragment, this.TestFormatTraceStream, this.TestFormatOutputTraceStream, this.filterHtml, this.htmlCallback, false);

            return(new HtmlFormatConverter(parser2, output2, false, this.testTraceStream, this.testTraceShowTokenNum, this.testTraceStopOnTokenNum, this.TestFormatConverterTraceStream, progressMonitor));
        }
        // Token: 0x06000EFA RID: 3834 RVA: 0x00073B80 File Offset: 0x00071D80
        internal IProducerConsumer CreateChain(RtfEncapsulation encapsulation, RtfParser parser, ConverterOutput output, IProgressMonitor progressMonitor)
        {
            this.rtfEncapsulation = encapsulation;
            if (this.reportBytes == null)
            {
                throw new InvalidOperationException("I have an RtfParser but no ReportBytes.");
            }
            output.ReportBytes = this.reportBytes;
            IProducerConsumer result;

            if (encapsulation != RtfEncapsulation.Html)
            {
                HtmlInjection injection = null;
                if (this.injectHead != null || this.injectTail != null)
                {
                    injection = new HtmlInjection(this.injectHead, this.injectTail, this.injectionFormat, this.filterHtml, this.htmlCallback, this.testBoundaryConditions, null, progressMonitor);
                }
                HtmlWriter         writer             = new HtmlWriter(output, this.filterHtml, !this.testNoNewLines);
                FormatOutput       output2            = new HtmlFormatOutput(writer, injection, this.outputFragment, this.testFormatTraceStream, this.testFormatOutputTraceStream, this.filterHtml, this.htmlCallback, true);
                RtfFormatConverter rtfFormatConverter = new RtfFormatConverter(parser, output2, null, false, this.testTraceStream, this.testTraceShowTokenNum, this.testTraceStopOnTokenNum, this.testFormatConverterTraceStream);
                result = rtfFormatConverter;
            }
            else
            {
                HtmlInjection htmlInjection  = null;
                HtmlInjection htmlInjection2 = null;
                try
                {
                    if (this.injectHead != null || this.injectTail != null)
                    {
                        htmlInjection2          = new HtmlInjection(this.injectHead, this.injectTail, this.injectionFormat, this.filterHtml, this.htmlCallback, this.testBoundaryConditions, null, progressMonitor);
                        htmlInjection           = htmlInjection2;
                        this.normalizeInputHtml = true;
                    }
                    if (this.filterHtml || this.outputFragment || this.htmlCallback != null)
                    {
                        this.normalizeInputHtml = true;
                    }
                    HtmlInRtfExtractingInput input = new HtmlInRtfExtractingInput(parser, this.maxHtmlTagSize, this.testBoundaryConditions, this.testTraceStream, this.testTraceShowTokenNum, this.testTraceStopOnTokenNum);
                    IHtmlParser parser3;
                    if (this.normalizeInputHtml)
                    {
                        HtmlParser parser2 = new HtmlParser(input, false, false, this.testMaxTokenRuns, this.testMaxHtmlTagAttributes, this.testBoundaryConditions);
                        parser3        = new HtmlNormalizingParser(parser2, htmlInjection, this.htmlCallback != null, this.testMaxHtmlNormalizerNesting, this.testBoundaryConditions, this.testNormalizerTraceStream, this.testNormalizerTraceShowTokenNum, this.testNormalizerTraceStopOnTokenNum);
                        htmlInjection2 = null;
                    }
                    else
                    {
                        parser3 = new HtmlParser(input, false, false, this.testMaxTokenRuns, this.testMaxHtmlTagAttributes, this.testBoundaryConditions);
                    }
                    HtmlWriter writer2 = new HtmlWriter(output, this.filterHtml, this.normalizeInputHtml && !this.testNoNewLines);
                    result = new HtmlToHtmlConverter(parser3, writer2, false, this.outputFragment, this.filterHtml, this.htmlCallback, this.testTruncateForCallback, htmlInjection != null && htmlInjection.HaveTail, this.testHtmlTraceStream, this.testHtmlTraceShowTokenNum, this.testHtmlTraceStopOnTokenNum, this.smallCssBlockThreshold, this.preserveDisplayNoneStyle, progressMonitor);
                }
                finally
                {
                    IDisposable disposable = htmlInjection2;
                    if (disposable != null)
                    {
                        disposable.Dispose();
                        htmlInjection2 = null;
                    }
                }
            }
            return(result);
        }
Esempio n. 5
0
 // Token: 0x0600147F RID: 5247 RVA: 0x0009286A File Offset: 0x00090A6A
 public HtmlFormatOutputCallbackContext(HtmlFormatOutput formatOutput)
 {
     this.formatOutput = formatOutput;
 }