Exemple #1
0
        protected virtual void RenderBottomControls(TabbedMultiViewRenderingContext renderingContext)
        {
            Style       style       = renderingContext.Control.BottomControlsStyle;
            PlaceHolder placeHolder = renderingContext.Control.BottomControl;
            string      cssClass    = CssClassBottomControls;

            RenderPlaceHolder(renderingContext, style, placeHolder, cssClass);
        }
Exemple #2
0
        protected virtual void RenderTabStrip(TabbedMultiViewRenderingContext renderingContext)
        {
            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassTabStrip);
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Td); // begin td

            renderingContext.Control.TabStrip.CssClass = CssClassTabStrip;
            renderingContext.Control.TabStrip.RenderControl(renderingContext.Writer);

            renderingContext.Writer.RenderEndTag(); // end td
        }
Exemple #3
0
 protected void AddAttributesToRender(TabbedMultiViewRenderingContext renderingContext)
 {
     AddStandardAttributesToRender(renderingContext);
     if (renderingContext.Control.IsDesignMode)
     {
         renderingContext.Writer.AddStyleAttribute("width", "100%");
         renderingContext.Writer.AddStyleAttribute("height", "75%");
     }
     if (string.IsNullOrEmpty(renderingContext.Control.CssClass) && string.IsNullOrEmpty(renderingContext.Control.Attributes["class"]))
     {
         renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassBase);
     }
 }
Exemple #4
0
        protected virtual void RenderActiveView(TabbedMultiViewRenderingContext renderingContext)
        {
            ScriptUtility.Instance.RegisterElementForBorderSpans(renderingContext.Control, "#" + renderingContext.Control.ActiveViewClientID + " > *:first");

            if (renderingContext.Control.IsDesignMode)
            {
                renderingContext.Writer.AddStyleAttribute("border", "solid 1px black");
            }
            renderingContext.Control.ActiveViewStyle.AddAttributesToRender(renderingContext.Writer);
            if (string.IsNullOrEmpty(renderingContext.Control.ActiveViewStyle.CssClass))
            {
                renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassActiveView);
            }
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Td); // begin td

            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Id, renderingContext.Control.ActiveViewClientID);
            renderingContext.Control.ActiveViewStyle.AddAttributesToRender(renderingContext.Writer);
            if (string.IsNullOrEmpty(renderingContext.Control.ActiveViewStyle.CssClass))
            {
                renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassActiveView);
            }
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div); // begin outer div

            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassViewBody);
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div); // begin body div

            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Id, renderingContext.Control.ActiveViewClientID + "_Content");
            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassContent);
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div); // begin content div

            var view = renderingContext.Control.GetActiveView();

            if (view != null)
            {
                for (int i = 0; i < view.Controls.Count; i++)
                {
                    Control control = view.Controls[i];
                    control.RenderControl(renderingContext.Writer);
                }
            }

            renderingContext.Writer.RenderEndTag(); // end content div
            renderingContext.Writer.RenderEndTag(); // end body div
            renderingContext.Writer.RenderEndTag(); // end outer div

            renderingContext.Writer.RenderEndTag(); // end td
        }
Exemple #5
0
        private void RenderPlaceHolder(TabbedMultiViewRenderingContext renderingContext, Style style, PlaceHolder placeHolder, string cssClass)
        {
            ScriptUtility.Instance.RegisterElementForBorderSpans(renderingContext.Control, "#" + placeHolder.ClientID + " > *:first");

            if (string.IsNullOrEmpty(style.CssClass))
            {
                if (placeHolder.Controls.Count > 0)
                {
                    renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass);
                }
                else
                {
                    renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass + " " + CssClassEmpty);
                }
            }
            else
            {
                if (placeHolder.Controls.Count > 0)
                {
                    renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, style.CssClass);
                }
                else
                {
                    renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, style.CssClass + " " + CssClassEmpty);
                }
            }
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Td); // begin td

            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Id, placeHolder.ClientID);
            style.AddAttributesToRender(renderingContext.Writer);
            if (string.IsNullOrEmpty(style.CssClass))
            {
                renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass);
            }
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div); // begin outer div

            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassContent);
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div); // begin content div

            placeHolder.RenderControl(renderingContext.Writer);

            renderingContext.Writer.RenderEndTag(); // end content div
            renderingContext.Writer.RenderEndTag(); // end outer div

            renderingContext.Writer.RenderEndTag(); // end td
        }
Exemple #6
0
        public void Render(TabbedMultiViewRenderingContext renderingContext)
        {
            ArgumentUtility.CheckNotNull("renderingContext", renderingContext);

            AddAttributesToRender(renderingContext);
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (!string.IsNullOrEmpty(renderingContext.Control.CssClass))
            {
                renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, renderingContext.Control.CssClass);
            }
            else if (!string.IsNullOrEmpty(renderingContext.Control.Attributes["class"]))
            {
                renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, renderingContext.Control.Attributes["class"]);
            }
            else
            {
                renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassBase);
            }

            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Table);

            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            RenderTopControls(renderingContext);
            renderingContext.Writer.RenderEndTag();

            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            RenderTabStrip(renderingContext);
            renderingContext.Writer.RenderEndTag();

            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            RenderActiveView(renderingContext);
            renderingContext.Writer.RenderEndTag();

            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            RenderBottomControls(renderingContext);
            renderingContext.Writer.RenderEndTag();

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