public void BeforeRender(IParrotWriter writer, IRendererFactory rendererFactory, Statement statement, IDictionary <string, object> documentHost, object model) { //process parameters if (statement.Parameters != null && statement.Parameters.Any()) { foreach (var parameter in statement.Parameters) { if (parameter.Value != null && ((parameter.Value.StartsWith("\"") && parameter.Value.EndsWith("\"")) || (parameter.Value.StartsWith("'") && parameter.Value.EndsWith("'")))) { var stringLiteral = new StringLiteral(parameter.Value); var renderer = rendererFactory.GetRenderer("string"); var w = new StandardWriter(); { renderer.Render(w, rendererFactory, stringLiteral, documentHost, model); } parameter.CalculatedValue = w.Result(); } } } }
protected void dispose() { StandardWriter?.DisposeIfDisposable(); ExceptionWriter?.DisposeIfDisposable(); }