Exemplo n.º 1
0
        /// <summary>Initializes a new instance of the <see cref="HtmlWriterVisitor"/> class.</summary>
        /// <param name="stringBuilder">The <see cref="StringBuilder"/> to which to write the result.</param>
        /// <param name="options">The <see cref="HtmlWriterVisitorOptions"/> to use when writing HTML.</param>
        /// <exception cref="ArgumentException">
        /// Thrown when the <see cref="HtmlWriterVisitorOptions.IndentOffset"/> is less than 0 (zero).
        /// </exception>
        public HtmlWriterVisitor(StringBuilder stringBuilder, HtmlWriterVisitorOptions options)
        {
            _htmlStringBuilder = stringBuilder ?? new StringBuilder();
            Options            = options ?? _defaultOptions;

            if (Options.IndentOffset < 0)
            {
                throw new ArgumentException("The IndentOffset cannot be negative.", nameof(options));
            }
        }
Exemplo n.º 2
0
 /// <summary>Initializes a new instance of the <see cref="HtmlWriterVisitor"/> class.</summary>
 /// <param name="options">The <see cref="HtmlWriterVisitorOptions"/> to use when writing HTML.</param>
 /// <exception cref="ArgumentException">Thrown when the <see cref="HtmlWriterVisitorOptions.IndentOffset"/> is less than 0 (zero).</exception>
 public HtmlWriterVisitor(HtmlWriterVisitorOptions options)
     : this(null, options)
 {
 }