protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            using (LogGroup logGroup = LogGroup.StartDebug("Rendering base XML projection."))
            {
                // If the DataSource is not null then perform the custom XML output
                if (DataSource != null)
                {
                    if (DataSource is IEntity)
                        Authorisation.EnsureUserCan("View", (IEntity)DataSource);
                    else
                        Authorisation.EnsureUserCan("View", (IEntity[])DataSource);

                    LogWriter.Debug("XSLT file path: " + XsltFilePath);

                    XmlProjectionRenderer renderer = new XmlProjectionRenderer(QueryStrings.Type);
                    renderer.DataSource = DataSource;
                    renderer.XsltFile = XsltFilePath;
                    renderer.Render(writer);
                }
                // Otherwise allow the standard render to occur
                else
                {
                    LogWriter.Debug("DataSource == null. Skipping dynamic render and using base render");

                    base.Render(writer);
                }
            }
        }
Beispiel #2
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            using (LogGroup logGroup = LogGroup.StartDebug("Rendering base XML projection."))
            {
                // If the DataSource is not null then perform the custom XML output
                if (DataSource != null)
                {
                    if (DataSource is IEntity)
                    {
                        Authorisation.EnsureUserCan("View", (IEntity)DataSource);
                    }
                    else
                    {
                        Authorisation.EnsureUserCan("View", (IEntity[])DataSource);
                    }

                    LogWriter.Debug("XSLT file path: " + XsltFilePath);

                    XmlProjectionRenderer renderer = new XmlProjectionRenderer(QueryStrings.Type);
                    renderer.DataSource = DataSource;
                    renderer.XsltFile   = XsltFilePath;
                    renderer.Render(writer);
                }
                // Otherwise allow the standard render to occur
                else
                {
                    LogWriter.Debug("DataSource == null. Skipping dynamic render and using base render");

                    base.Render(writer);
                }
            }
        }