Exemple #1
0
        protected virtual void RenderContents(BocListRenderingContext renderingContext)
        {
            ArgumentUtility.CheckNotNull("renderingContext", renderingContext);

            //  Render list block / menu block
            renderingContext.Writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0");
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Table);

            RenderTopLevelColumnGroup = (ctx) => RenderTopLevelColumnGroupForLegacyBrowser(ctx);
            if (!ControlHelper.IsDesignMode(renderingContext.Control))
            {
                bool isXmlRequired = (renderingContext.HttpContext != null) && ControlHelper.IsXmlConformResponseTextRequired(renderingContext.HttpContext);
                if (isXmlRequired)
                {
                    RenderTopLevelColumnGroup = (ctx) => RenderTopLevelColumnGroupForXmlBrowser(ctx);
                }
            }

            RenderTopLevelColumnGroup(renderingContext);

            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            //  List Block
            renderingContext.Writer.AddStyleAttribute("vertical-align", "top");
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Td);

            TableBlockRenderer.Render(renderingContext);

            if (renderingContext.Control.HasNavigator)
            {
                NavigationBlockRenderer.Render(renderingContext);
            }

            renderingContext.Writer.RenderEndTag();

            if (renderingContext.Control.HasMenuBlock)
            {
                //  Menu Block
                renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClasses.MenuBlock);
                renderingContext.Writer.AddStyleAttribute("vertical-align", "top");
                renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Td);
                MenuBlockRenderer.Render(renderingContext);
                renderingContext.Writer.RenderEndTag();
            }

            renderingContext.Writer.RenderEndTag(); //  TR
            renderingContext.Writer.RenderEndTag(); //  Table
        }
        protected virtual void RenderContents(BocListRenderingContext renderingContext)
        {
            ArgumentUtility.CheckNotNull("renderingContext", renderingContext);

            //  Menu Block
            if (renderingContext.Control.HasMenuBlock)
            {
                renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClasses.MenuBlock);

                if (!renderingContext.Control.MenuBlockWidth.IsEmpty)
                {
                    renderingContext.Writer.AddStyleAttribute(HtmlTextWriterStyle.Width, renderingContext.Control.MenuBlockWidth.ToString());
                }

                renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (!renderingContext.Control.MenuBlockOffset.IsEmpty)
                {
                    renderingContext.Writer.AddStyleAttribute(HtmlTextWriterStyle.MarginLeft, renderingContext.Control.MenuBlockOffset.ToString());
                }
                renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div);

                MenuBlockRenderer.Render(renderingContext);

                renderingContext.Writer.RenderEndTag();
                renderingContext.Writer.RenderEndTag();
            }

            //  Table Block
            renderingContext.Writer.AddAttribute(
                HtmlTextWriterAttribute.Class, CssClasses.GetTableBlock(renderingContext.Control.HasMenuBlock, renderingContext.Control.HasNavigator));
            if (renderingContext.Control.HasMenuBlock && !renderingContext.Control.MenuBlockWidth.IsEmpty)
            {
                renderingContext.Writer.AddStyleAttribute("right", renderingContext.Control.MenuBlockWidth.ToString());
            }
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div);

            TableBlockRenderer.Render(renderingContext);

            if (renderingContext.Control.HasNavigator)
            {
                NavigationBlockRenderer.Render(renderingContext);
            }

            renderingContext.Writer.RenderEndTag();
        }