/// <summary> /// Initializes a new instance of the <see cref="Context"/> class. /// </summary> /// <param name="view">The data view to create the context with</param> /// <param name="registry">A reference to the a registry instance</param> /// <param name="parentContext">The parent context for the new context</param> /// <param name="settings">The render settings </param> public Context(object view, Registry registry, Context parentContext, RenderSettings settings) { this.view = view; View = this.view; ParentContext = parentContext; Registry = registry; RenderSettings = settings; Cache = new Dictionary<string, object>() { { ".", TryEnumerationConversionIfRequired(this.view) } }; }
/// <summary> /// Initializes a new instance of the <see cref="Writer"/> class /// with a explicit registry and cacheSize of 15 /// </summary> /// <param name="registry">The registry to use</param> public Writer(Registry registry) : this(15, registry) { }
/// <summary> /// Initializes a new instance of the <see cref="Writer"/> class /// with a cacheLimit and explicit registry /// </summary> /// <param name="cacheLimit">The max size of the template token cache</param> /// <param name="registry">The registry to use</param> public Writer(int cacheLimit, Registry registry) { Registry = registry; Cache = new LimitedSizeConcurrentDictionary<string, IList<ParserOutput>>(cacheLimit); Parser = new Parser(Registry); }
/// <summary> /// Initializes a new instance of the <see cref="Context"/> class. /// </summary> /// <param name="view">The data view to create the context with</param> /// <param name="registry">A reference to the a registry instance</param> /// <param name="settings">The render settings </param> public Context(object view, Registry registry, RenderSettings settings) : this(view, registry, null, settings) { }
/// <summary> /// Initializes a new instance of the <see cref="StubbleRenderer"/> class /// with a passed Registry /// </summary> /// <param name="registry">A registry instance</param> internal StubbleRenderer(Registry registry) { Registry = registry; Writer = new Writer(Registry); }