コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextOutput"/> class.
        /// </summary>
        /// <param name="output">The converted output.</param>
        /// <param name="lineWrapping">if set to <c>true</c> allow line wrapping.</param>
        /// <param name="flowed">if set to <c>true</c> allow flowing.</param>
        /// <param name="wrapBeforePosition">The wrap before position.</param>
        /// <param name="longestNonWrappedParagraph">The longest non wrapped paragraph.</param>
        /// <param name="imageRenderingCallback">The image rendering callback.</param>
        /// <param name="fallbacks">if set to <c>true</c> allow fallbacks.</param>
        /// <param name="htmlEscape">if set to <c>true</c> escape HTML.</param>
        /// <param name="preserveSpace">if set to <c>true</c> preserve spaces.</param>
        /// <param name="testTraceStream">The test trace stream.</param>
        public TextOutput(
            ConverterOutput output,
            bool lineWrapping,
            bool flowed,
            int wrapBeforePosition,
            int longestNonWrappedParagraph,
            ImageRenderingCallbackInternal imageRenderingCallback,
            bool fallbacks,
            bool htmlEscape,
            bool preserveSpace,
            Stream testTraceStream)
        {
            this.rfc2646                    = flowed;
            this.lineWrapping               = lineWrapping;
            this.wrapBeforePosition         = wrapBeforePosition;
            this.longestNonWrappedParagraph = longestNonWrappedParagraph;

            if (!this.lineWrapping)
            {
                this.preserveTrailingSpace = preserveSpace;
                this.preserveTabulation    = preserveSpace;
                this.preserveNbsp          = preserveSpace;
            }

            this.output = output;

            this.fallbacks  = fallbacks;
            this.htmlEscape = htmlEscape;

            this.imageRenderingCallback = imageRenderingCallback;
            this.wrapBuffer             = new char[(this.longestNonWrappedParagraph + 1) * 5];
        }
コード例 #2
0
ファイル: HtmlToText.cs プロジェクト: YHZX2013/exchange_diff
 internal HtmlToText SetImageRenderingCallback(ImageRenderingCallbackInternal value)
 {
     this.imageRenderingCallback = value;
     return(this);
 }