Exemplo n.º 1
0
        /// <summary>
        /// Renders the meta view of the view associated with the specified <paramref name="viewContext"/> 
        /// and <paramref name="writer"/>.
        /// </summary>
        /// <param name="viewContext">The view context.</param>
        /// <param name="writer">The writer to write to.</param>
        public override void Render(ViewContext viewContext, TextWriter writer)
        {
            SageController controller = (SageController) viewContext.Controller;
            XmlDocument requestXml = controller.PrepareViewXml(viewContext);

            QueryString query = new QueryString(viewContext.HttpContext.Request.QueryString);
            bool prettyPrint = query.HasValid("pretty", "1|true|yes");
            viewContext.HttpContext.Response.ContentType = this.Info.ContentType;
            writer.Write(requestXml.DocumentElement.ToJson(prettyPrint));
        }