/// <summary> /// Initializes a new instance of the <see cref="ParserOptions" /> class. /// </summary> /// <param name="template">The template.</param> /// <param name="sourceStream">The source stream.</param> /// <param name="encoding">The encoding.</param> public ParserOptions([NotNull] string template, [CanBeNull] Func <Stream> sourceStream, [CanBeNull] Encoding encoding) { Template = template ?? ""; StreamFactory = new ByteCounterFactory(sourceStream); Encoding = encoding ?? Encoding.UTF8; _formatters = new MorestachioFormatterService(); Null = string.Empty; MaxSize = 0; DisableContentEscaping = false; Timeout = TimeSpan.Zero; PartialStackSize = 255; _customDocumentItemProviders = new SealableList <CustomDocumentItemProvider>(); CultureInfo = CultureInfo.CurrentCulture; }
/// <summary> /// Initializes a new instance of the <see cref="ParserOptions" /> class. /// </summary> /// <param name="template">The template.</param> /// <param name="sourceStream">The source stream.</param> /// <param name="encoding">The encoding.</param> public ParserOptions(ITemplateContainer template, Func <ParserOptions, IByteCounterStream> sourceStream, Encoding encoding) { Template = template ?? new StringTemplateContainer(""); StreamFactory = new ByteCounterFactory(sourceStream); Encoding = encoding ?? Encoding.UTF8; _formatters = new MorestachioFormatterService(); Null = string.Empty; MaxSize = 0; DisableContentEscaping = false; Timeout = TimeSpan.Zero; PartialStackSize = 255; _customDocumentItemProviders = new CustomDocumentList(); CultureInfo = CultureInfo.CurrentCulture; UnmatchedTagBehavior = UnmatchedTagBehavior.ThrowError | UnmatchedTagBehavior.LogWarning; }
/// <summary> /// Initializes a new instance of the <see cref="ParserOptions" /> class. /// </summary> /// <param name="template">The template.</param> /// <param name="sourceStream">The source stream.</param> /// <param name="encoding">The encoding.</param> public ParserOptions(ITemplateContainer template, Func <Stream> sourceStream, Encoding encoding) : this(template, ByteCounterFactory.GetDefaultByteCounter(sourceStream), encoding) { }