Пример #1
0
        /// <summary>
        /// Debugs the render.
        /// </summary>
        /// <param name="writer">The writer.</param>
        protected void DebugRender(HtmlTextWriter writer)
        {
            SPSEditorPartsTools editorTools = new SPSEditorPartsTools(writer);

            if (DebugQuery)
            {
                if (!string.IsNullOrEmpty(CamlQuery))
                {
                    WriteDebug(writer, "DEBUG CAML Query (No Query)", string.Empty);
                }
                else
                {
                    string resultQuery = editorTools.FormatXml(CamlQuery);
                    WriteDebug(writer, "DEBUG CAML Query (Original)", resultQuery);
                    resultQuery = editorTools.FormatXml(_camlPreprocessor.Evaluate());
                    WriteDebug(writer, "DEBUG CAML Query (Processed)", resultQuery);
                }
            }

            if (DebugResults)
            {
                WriteDebug(writer, "DEBUG XML DATA", editorTools.FormatXml(_collector.GetXml()));
            }

            if (DebugEvaluator)
            {
                writer.Write("<font color=red>DEBUG Evaluator</font><br>");
                writer.Write(EvaluatorSample());
                writer.Write("<br>");
            }
        }
        protected void DebugRender(HtmlTextWriter writer)
        {
            SPSEditorPartsTools editorTools = new SPSEditorPartsTools(writer);

            if (DebugQuery)
            {
                string resultQuery = editorTools.FormatXml(CamlQuery);
                writer.Write("<font color=red>DEBUG CAML Query (Original)</font><br><font color=blue>");
                writer.Write("<pre>" + SPEncode.HtmlEncode(resultQuery) + "</pre>");
                writer.Write("</font><br>");
                resultQuery = editorTools.FormatXml(_camlPreprocessor.Preprocess());
                writer.Write("<font color=red>DEBUG CAML Query (Processed)</font><br><font color=blue>");
                writer.Write("<pre>" + SPEncode.HtmlEncode(resultQuery) + "</pre>");
                writer.Write("</font><br>");
            }


            if (DebugResults)
            {
                writer.Write("<font color=red>DEBUG XML DATA</font><br><font color=blue>");
                writer.Write("<pre>" +
                             SPEncode.HtmlEncode(editorTools.FormatXml(_rollupEngine.Data.GetXml())) +
                             "</pre>");
                writer.Write("</font><br>");
            }

            if (DebugEvaluator)
            {
                writer.Write("<font color=red>DEBUG Evaluator</font><br>");
                writer.Write(EvaluatorSample());
                writer.Write("<br>");
            }
        }
        /// <summary>
        /// Debugs the render.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="transformed">The transformated.</param>
        internal void DebugRender(HtmlTextWriter writer, string transformed)
        {
            SPSEditorPartsTools tools = new SPSEditorPartsTools(writer);

            //if (DebugSource)
            //{
            //    writer.Write("<font color=red>DEBUG XML DATA</font><br><font color=blue>");
            //    writer.Write("<pre>" + SPEncode.HtmlEncode(tools.FormatXml(XmlData)) + "</pre>");
            //    writer.Write("</font><br>");
            //}

            if (DebugTransformation)
            {
                writer.Write("<font color=red>DEBUG XML TRANSFORM</font><br><font color=blue>");
                writer.Write("<pre>" + SPEncode.HtmlEncode(tools.FormatXml(transformed)) + "</pre>");
                writer.Write("</font><br>");
            }
        }