ApplyStyle() public method

public ApplyStyle ( System.Web.UI.WebControls.Style s ) : void
s System.Web.UI.WebControls.Style
return void
Example #1
0
        void RenderBeginTag(HtmlTextWriter w, Style s, WebControl wc)
        {
            WebControl c;

            switch (RepeatLayout)
            {
            case RepeatLayout.Table:
                c = new Table();
                break;

            case RepeatLayout.Flow:
                c = new Label();
                break;

            case RepeatLayout.OrderedList:
                c = new WebControl(HtmlTextWriterTag.Ol);
                break;

            case RepeatLayout.UnorderedList:
                c = new WebControl(HtmlTextWriterTag.Ul);
                break;

            default:
                throw new InvalidOperationException(String.Format("Unsupported RepeatLayout value '{0}'.", RepeatLayout));
            }

            c.ID = wc.ClientID;
            c.CopyBaseAttributes(wc);
            c.ApplyStyle(s);
            c.Enabled = wc.IsEnabled;
            c.RenderBeginTag(w);
        }
Example #2
0
        /// <devdoc>
        /// Sets the visiblity, style, and other properties of child controls.
        /// </devdoc>
        private void SetChildProperties()
        {
            EnsureChildControls();

            // Set all buttons to nonvisible, then later set the selected button to visible
            _logInLinkButton.Visible   = false;
            _logInImageButton.Visible  = false;
            _logOutLinkButton.Visible  = false;
            _logOutImageButton.Visible = false;

            WebControl visibleControl = null;
            bool       loggedIn       = LoggedIn;

            if (loggedIn)
            {
                string logoutImageUrl = LogoutImageUrl;
                if (logoutImageUrl.Length > 0)
                {
                    _logOutImageButton.AlternateText = LogoutText;
                    _logOutImageButton.ImageUrl      = logoutImageUrl;
                    visibleControl = _logOutImageButton;
                }
                else
                {
                    _logOutLinkButton.Text = LogoutText;
                    visibleControl         = _logOutLinkButton;
                }
            }
            else
            {
                string loginImageUrl = LoginImageUrl;
                if (loginImageUrl.Length > 0)
                {
                    _logInImageButton.AlternateText = LoginText;
                    _logInImageButton.ImageUrl      = loginImageUrl;
                    visibleControl = _logInImageButton;
                }
                else
                {
                    _logInLinkButton.Text = LoginText;
                    visibleControl        = _logInLinkButton;
                }
            }

            visibleControl.CopyBaseAttributes(this);
            visibleControl.ApplyStyle(ControlStyle);
            visibleControl.Visible = true;
        }
Example #3
0
        private void SetChildProperties()
        {
            this.EnsureChildControls();
            this._logInLinkButton.Visible   = false;
            this._logInImageButton.Visible  = false;
            this._logOutLinkButton.Visible  = false;
            this._logOutImageButton.Visible = false;
            WebControl control = null;

            if (this.LoggedIn)
            {
                string logoutImageUrl = this.LogoutImageUrl;
                if (logoutImageUrl.Length > 0)
                {
                    this._logOutImageButton.AlternateText = this.LogoutText;
                    this._logOutImageButton.ImageUrl      = logoutImageUrl;
                    control = this._logOutImageButton;
                }
                else
                {
                    this._logOutLinkButton.Text = this.LogoutText;
                    control = this._logOutLinkButton;
                }
            }
            else
            {
                string loginImageUrl = this.LoginImageUrl;
                if (loginImageUrl.Length > 0)
                {
                    this._logInImageButton.AlternateText = this.LoginText;
                    this._logInImageButton.ImageUrl      = loginImageUrl;
                    control = this._logInImageButton;
                }
                else
                {
                    this._logInLinkButton.Text = this.LoginText;
                    control = this._logInLinkButton;
                }
            }
            control.CopyBaseAttributes(this);
            control.ApplyStyle(base.ControlStyle);
            control.Visible = true;
        }
        protected virtual void InitializeItem(SiteMapNodeItem item)
        {
            switch (item.ItemType)
            {
            case SiteMapNodeItemType.Root:
                if (RootNodeTemplate != null)
                {
                    item.ApplyStyle(NodeStyle);
                    item.ApplyStyle(RootNodeStyle);
                    RootNodeTemplate.InstantiateIn(item);
                }
                else if (NodeTemplate != null)
                {
                    item.ApplyStyle(NodeStyle);
                    item.ApplyStyle(RootNodeStyle);
                    NodeTemplate.InstantiateIn(item);
                }
                else
                {
                    WebControl c = CreateHyperLink(item);
                    c.ApplyStyle(NodeStyle);
                    c.ApplyStyle(RootNodeStyle);
                    item.Controls.Add(c);
                }
                break;

            case SiteMapNodeItemType.Current:
                if (CurrentNodeTemplate != null)
                {
                    item.ApplyStyle(NodeStyle);
                    item.ApplyStyle(CurrentNodeStyle);
                    CurrentNodeTemplate.InstantiateIn(item);
                }
                else if (NodeTemplate != null)
                {
                    item.ApplyStyle(NodeStyle);
                    item.ApplyStyle(CurrentNodeStyle);
                    NodeTemplate.InstantiateIn(item);
                }
                else if (RenderCurrentNodeAsLink)
                {
                    HyperLink c = CreateHyperLink(item);
                    c.ApplyStyle(NodeStyle);
                    c.ApplyStyle(CurrentNodeStyle);
                    item.Controls.Add(c);
                }
                else
                {
                    Literal c = CreateLiteral(item);
                    item.ApplyStyle(NodeStyle);
                    item.ApplyStyle(CurrentNodeStyle);
                    item.Controls.Add(c);
                }
                break;

            case SiteMapNodeItemType.Parent:
                if (NodeTemplate != null)
                {
                    item.ApplyStyle(NodeStyle);
                    NodeTemplate.InstantiateIn(item);
                }
                else
                {
                    WebControl c = CreateHyperLink(item);
                    c.ApplyStyle(NodeStyle);
                    item.Controls.Add(c);
                }
                break;

            case SiteMapNodeItemType.PathSeparator:
                if (PathSeparatorTemplate != null)
                {
                    item.ApplyStyle(PathSeparatorStyle);
                    PathSeparatorTemplate.InstantiateIn(item);
                }
                else
                {
                    Literal h = new Literal();
                    h.Text = HttpUtility.HtmlEncode(PathSeparator);
                    item.ApplyStyle(PathSeparatorStyle);
                    item.Controls.Add(h);
                }
                break;
            }
        }
Example #5
0
		void RenderBeginTag (HtmlTextWriter w, Style s, WebControl wc)
		{
			WebControl c;
			switch (RepeatLayout) {	
				case RepeatLayout.Table:
					c = new Table ();
					break;
					
				case RepeatLayout.Flow:
					c = new Label ();
					break;
				case RepeatLayout.OrderedList:
					c = new WebControl (HtmlTextWriterTag.Ol);
					break;

				case RepeatLayout.UnorderedList:
					c = new WebControl (HtmlTextWriterTag.Ul);
					break;
				default:
					throw new InvalidOperationException (String.Format ("Unsupported RepeatLayout value '{0}'.", RepeatLayout));
			}

			c.ID = wc.ClientID;
			c.CopyBaseAttributes (wc);
			c.ApplyStyle (s);
			c.Enabled = wc.IsEnabled;
			c.RenderBeginTag (w);
		}
Example #6
0
        /// <include file='doc\RepeatInfo.uex' path='docs/doc[@for="RepeatInfo.RenderHorizontalRepeater"]/*' />
        /// <devdoc>
        /// </devdoc>
        private void RenderHorizontalRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
        {
            Debug.Assert(outerTableImplied == false, "Cannot use outer implied table with Horizontal layout");

            int itemCount = user.RepeatedItemCount;

            int totalColumns  = repeatColumns;
            int currentColumn = 0;

            if (totalColumns == 0)
            {
                // 0 implies a complete horizontal repetition without any
                // column count constraints
                totalColumns = itemCount;
            }

            WebControl outerControl = null;
            bool       tableLayout  = false;

            switch (repeatLayout)
            {
            case RepeatLayout.Table:
                outerControl = new Table();
                tableLayout  = true;
                break;

            case RepeatLayout.Flow:
                outerControl = new WebControl(HtmlTextWriterTag.Span);
                break;
            }

            bool separators = user.HasSeparators;

            // use ClientID (and not ID) since we want to render out the fully qualified client id
            // even though this outer control will not be parented to the control hierarchy
            outerControl.ID = baseControl.ClientID;

            outerControl.CopyBaseAttributes(baseControl);
            outerControl.ApplyStyle(controlStyle);
            outerControl.RenderBeginTag(writer);

            if (user.HasHeader)
            {
                if (tableLayout)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                    // add attributes to render for TD
                    if ((totalColumns != 1) || separators)
                    {
                        int columnSpan = totalColumns;
                        if (separators)
                        {
                            columnSpan += totalColumns;
                        }
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, columnSpan.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    // add style attributes to render for TD
                    Style style = user.GetItemStyle(ListItemType.Header, -1);
                    if (style != null)
                    {
                        style.AddAttributesToRender(writer);
                    }
                    // render begin tag for TD
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Header, -1, this, writer);
                if (tableLayout)
                {
                    // render end tag for TD
                    writer.RenderEndTag();

                    // render end tag for TR
                    writer.RenderEndTag();
                }
                else
                {
                    if (totalColumns < itemCount)
                    {
                        // we have multiple rows, so have a break between the header and first row.
                        writer.WriteFullBeginTag("br");
                    }
                }
            }

            for (int i = 0; i < itemCount; i++)
            {
                if (tableLayout && (currentColumn == 0))
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                }

                if (tableLayout)
                {
                    // add style attributes to render for TD
                    Style style = user.GetItemStyle(ListItemType.Item, i);
                    if (style != null)
                    {
                        style.AddAttributesToRender(writer);
                    }
                    // render begin tag for TD
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Item, i, this, writer);
                if (tableLayout)
                {
                    // render end tag for TD
                    writer.RenderEndTag();
                }
                if (separators && (i != (itemCount - 1)))
                {
                    if (tableLayout)
                    {
                        Style style = user.GetItemStyle(ListItemType.Separator, i);
                        if (style != null)
                        {
                            style.AddAttributesToRender(writer);
                        }
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    }
                    user.RenderItem(ListItemType.Separator, i, this, writer);
                    if (tableLayout)
                    {
                        writer.RenderEndTag();
                    }
                }

                currentColumn++;
                if ((currentColumn == totalColumns) || (i == itemCount - 1))
                {
                    if (tableLayout)
                    {
                        // End tag for TR
                        writer.RenderEndTag();
                    }
                    else
                    {
                        // write out the <br> after rows when there are multiple rows
                        if (totalColumns < itemCount)
                        {
                            writer.WriteFullBeginTag("br");
                        }
                    }

                    currentColumn = 0;
                }
            }

            if (user.HasFooter)
            {
                if (tableLayout)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                    if ((totalColumns != 1) || separators)
                    {
                        // add attributes to render for TD
                        int columnSpan = totalColumns;
                        if (separators)
                        {
                            columnSpan += totalColumns;
                        }
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, columnSpan.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    // add style attributes to render for TD
                    Style style = user.GetItemStyle(ListItemType.Footer, -1);
                    if (style != null)
                    {
                        style.AddAttributesToRender(writer);
                    }
                    // render begin tag for TD
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Footer, -1, this, writer);
                if (tableLayout)
                {
                    // render end tag for TR and TD
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
            }

            outerControl.RenderEndTag(writer);
        }
Example #7
0
        public Control CreateControl(IConfigurationElement controlElement, string index, IBinder binder, ITemplatingItem item, WebControl container, TableItemStyle invalidStyle, Dictionary<string, Control> registry, WebPartManager manager)
        {
            if (null == this._monitor)
            {
                throw new ApplicationException("Monitor not set");
            }
            Control result;
            if (!controlElement.Attributes.ContainsKey("proxy") && !controlElement.Attributes.ContainsKey("type"))
            {
                result = null;
            }
            else
            {
                Control cellControl = null;
                string cellControlName = null;
                if (controlElement.Attributes.ContainsKey("proxy"))
                {
                    object proxyIDValue = controlElement.GetAttributeReference("proxy").Value;
                    string proxyID = null;
                    if (null != proxyIDValue)
                    {
                        proxyID = proxyIDValue.ToString();
                    }
                    if (string.IsNullOrEmpty(proxyID))
                    {
                        result = null;
                        return result;
                    }
                    Control proxy = ReflectionServices.FindControlEx(proxyID, manager);
                    if (null == proxy)
                    {
                        this._monitor.Register(this, this._monitor.NewEventInstance("create proxy error", null, new ApplicationException("can't find proxy " + proxyID), EVENT_TYPE.Error));
                    }
                    string proxyMember = null;
                    if (!controlElement.Attributes.ContainsKey("proxyMember"))
                    {
                        this._monitor.Register(this, this._monitor.NewEventInstance("create proxy error", null, new ApplicationException("proxyMember not found for proxy " + proxyID), EVENT_TYPE.Error));
                    }
                    else
                    {
                        proxyMember = controlElement.GetAttributeReference("proxyMember").Value.ToString();
                    }
                    try
                    {
                        cellControl = (ReflectionServices.ExtractValue(proxy, proxyMember) as Control);
                        cellControlName = proxy + "." + proxyMember;
                    }
                    catch (Exception ex)
                    {
                        this._monitor.Register(this, this._monitor.NewEventInstance("create proxy error", null, ex, EVENT_TYPE.Error));
                    }
                    if (cellControl == null && null != proxy)
                    {
                        this._monitor.Register(this, this._monitor.NewEventInstance("create proxy error", null, new ApplicationException(string.Format("member {0} of proxy type {1} is not a Control", proxyMember, proxy.GetType().FullName)), EVENT_TYPE.Error));
                    }
                }
                else
                {
                    Control scope = container;
                    if (container is TableCell)
                    {
                        scope = container.Parent.Parent;
                    }
                    try
                    {
                        cellControl = this.CreateControl(controlElement.GetAttributeReference("type").Value.ToString(), new bool?(item == null || item.IsReadOnly), scope);
                        cellControlName = controlElement.GetAttributeReference("type").Value.ToString();
                    }
                    catch (Exception ex)
                    {
                        this._monitor.Register(this, this._monitor.NewEventInstance("create control error", null, ex, EVENT_TYPE.Error));
                    }
                }
                if (null == cellControl)
                {
                    result = null;
                }
                else
                {
                    string type = null;
                    if (controlElement.Attributes.ContainsKey("type"))
                    {
                        type = controlElement.GetAttributeReference("type").Value.ToString();
                        if (cellControl is IButtonControl)
                        {
                            IButtonControl btn = cellControl as IButtonControl;
                            if (("Commander" == type || "LinkCommander" == type) && !controlElement.Attributes.ContainsKey("command"))
                            {
                                this._monitor.Register(this, this._monitor.NewEventInstance(string.Format("create {0} error", type), null, new ApplicationException("command not found"), EVENT_TYPE.Error));
                            }
                            else
                            {
                                if (controlElement.Attributes.ContainsKey("command"))
                                {
                                    btn.CommandName = controlElement.GetAttributeReference("command").Value.ToString();
                                }
                            }
                            btn.CommandArgument = index;
                        }
                        if (cellControl is StatelessDropDownList)
                            ((StatelessDropDownList)cellControl).CommandArgument = index;
                    }
                    if (null != registry)
                    {
                        registry.Add(controlElement.ConfigKey, cellControl);
                    }
                    var properties = controlElement.Elements.Values;
                    foreach (IConfigurationElement controlPropertyElement in properties)
                    {
                        if (!controlPropertyElement.Attributes.ContainsKey("for") || !("cell" == controlPropertyElement.GetAttributeReference("for").Value.ToString()))
                        {
                            string propertyName = null;
                            if (!controlPropertyElement.Attributes.ContainsKey("member"))
                            {
                                this._monitor.Register(this, this._monitor.NewEventInstance(string.Format("'{0}' property set error", cellControlName), null, new ApplicationException(string.Format("member not found for '{0}'", controlPropertyElement.ConfigKey)), EVENT_TYPE.Error));
                            }
                            else
                            {
                                propertyName = controlPropertyElement.GetAttributeReference("member").Value.ToString();
                            }

                            IExpression expression = null;
                            LWAS.Extensible.Interfaces.IResult expressionResult = null;
                            if (controlPropertyElement.Elements.ContainsKey("expression"))
                            {
                                IConfigurationElement expressionElement = controlPropertyElement.GetElementReference("expression");
                                Manager sysmanager = manager as Manager;
                                if (null != sysmanager && null != sysmanager.ExpressionsManager && expressionElement.Attributes.ContainsKey("type"))
                                {
                                    expression = sysmanager.ExpressionsManager.Token(expressionElement.GetAttributeReference("type").Value.ToString()) as IExpression;
                                    if (null != expression)
                                    {
                                        try
                                        {
                                            expression.Make(expressionElement, sysmanager.ExpressionsManager);
                                            expressionResult = expression.Evaluate();
                                        }
                                        catch (ArgumentException ax)
                                        {
                                        }
                                    }
                                }
                            }

                            object defaultValue = null;
                            if (!string.IsNullOrEmpty(propertyName) && controlPropertyElement.Attributes.ContainsKey("value"))
                            {
                                defaultValue = controlPropertyElement.GetAttributeReference("value").Value;
                                if (null == expression || null == binder)
                                {
                                    try
                                    {
                                        if (string.IsNullOrEmpty(cellControlName) ||
                                            propertyName != this.KnownTypes[cellControlName].ReadOnlyProperty ||
                                            (propertyName == this.KnownTypes[cellControlName].ReadOnlyProperty && defaultValue != null && !string.IsNullOrEmpty(defaultValue.ToString())))
                                        {
                                            if (propertyName == "Watermark")
                                            {
                                                if (null != defaultValue && !String.IsNullOrEmpty(defaultValue.ToString()))
                                                    ReflectionServices.SetValue(cellControl, propertyName, defaultValue);
                                            }
                                            else
                                                ReflectionServices.SetValue(cellControl, propertyName, defaultValue);
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        this._monitor.Register(this, this._monitor.NewEventInstance(string.Format("'{0}'.'{1}'='{2}' error", cellControlName, propertyName, controlPropertyElement.GetAttributeReference("value").Value), null, ex, EVENT_TYPE.Error));
                                    }
                                }
                                else
                                {
                                    IBindingItem bindingItem = binder.NewBindingItemInstance();
                                    bindingItem.Source = new Dictionary<string, object>() { { "0", defaultValue} };
                                    bindingItem.SourceProperty = "0";
                                    bindingItem.Target = cellControl;
                                    bindingItem.TargetProperty = propertyName;
                                    bindingItem.Expression = expression;
                                    bindingItem.ExpressionEvaluationResult = expressionResult;
                                    binder.BindingItems.Add(bindingItem);
                                }
                            }

                            if (controlPropertyElement.Attributes.ContainsKey("isList") && (bool)controlPropertyElement.GetAttributeReference("isList").Value)
                            {
                                object list = null;
                                try
                                {
                                    list = ReflectionServices.ExtractValue(cellControl, propertyName);
                                    if (null == list) throw new InvalidOperationException(string.Format("Member '{0}' is empty", propertyName));
                                    if (!(list is ListItemCollection) && !(list is IDictionary<string, object>)) throw new InvalidOperationException(String.Format("Unsupported list type '{0}'", list.GetType().Name));
                                }
                                catch (Exception ex)
                                {
                                    this._monitor.Register(this, this._monitor.NewEventInstance("failed to retrive the list", null, ex, EVENT_TYPE.Error));
                                }
                                if (null != list)
                                {
                                    if (controlPropertyElement.Attributes.ContainsKey("hasEmpty") && (bool)controlPropertyElement.GetAttributeReference("hasEmpty").Value)
                                    {
                                        if (list is ListItemCollection)
                                            ((ListItemCollection)list).Add("");
                                        else if (list is Dictionary<string, object>)
                                            ((Dictionary<string, object>)list).Add("", "");
                                    }
                                    foreach (IConfigurationElement listItemElement in controlPropertyElement.Elements.Values)
                                    {
                                        string value = null;
                                        string text = null;
                                        string pull = null;
                                        if (listItemElement.Attributes.ContainsKey("value") && null != listItemElement.GetAttributeReference("value").Value)
                                            value = listItemElement.GetAttributeReference("value").Value.ToString();
                                        if (listItemElement.Attributes.ContainsKey("text") && null != listItemElement.GetAttributeReference("text").Value)
                                            text = listItemElement.GetAttributeReference("text").Value.ToString();
                                        if (listItemElement.Attributes.ContainsKey("pull") && null != listItemElement.GetAttributeReference("pull").Value)
                                            pull = listItemElement.GetAttributeReference("pull").Value.ToString();

                                        if (list is ListItemCollection)
                                        {
                                            ListItem li = new ListItem(text, value);
                                            ((ListItemCollection)list).Add(li);
                                            if (null != binder && !String.IsNullOrEmpty(pull))
                                            {
                                                IBindingItem bindingItem = binder.NewBindingItemInstance();
                                                bindingItem.Source = item.Data;
                                                bindingItem.SourceProperty = pull;
                                                bindingItem.Target = li;
                                                bindingItem.TargetProperty = "Text";
                                                bindingItem.Expression = expression;
                                                binder.BindingItems.Add(bindingItem);
                                            }
                                        }
                                        else if (list is Dictionary<string, object>)
                                        {
                                            ((Dictionary<string, object>)list).Add(value, text);
                                            if (null != binder && !String.IsNullOrEmpty(pull))
                                            {
                                                IBindingItem bindingItem = binder.NewBindingItemInstance();
                                                bindingItem.Source = item.Data;
                                                bindingItem.SourceProperty = pull;
                                                bindingItem.Target = list;
                                                bindingItem.TargetProperty = value;
                                                bindingItem.Expression = expression;
                                                binder.BindingItems.Add(bindingItem);
                                            }
                                        }
                                    }
                                }
                            }
                            if (controlPropertyElement.Attributes.ContainsKey("property"))
                            {
                                if (container.Page != null && null != binder)
                                {
                                    IBindingItem bindingItem = binder.NewBindingItemInstance();
                                    bindingItem.Source = WebPartManager.GetCurrentWebPartManager(container.Page);
                                    bindingItem.SourceProperty = "WebParts." + controlPropertyElement.GetAttributeReference("property").Value.ToString();
                                    bindingItem.Target = cellControl;
                                    bindingItem.TargetProperty = propertyName;
                                    if (string.IsNullOrEmpty(cellControlName) || propertyName != this.KnownTypes[cellControlName].ReadOnlyProperty)
                                        bindingItem.DefaultValue = defaultValue;
                                    bindingItem.Expression = expression;
                                    binder.BindingItems.Add(bindingItem);
                                }
                            }
                            if (controlPropertyElement.Attributes.ContainsKey("pull"))
                            {
                                string pull = controlPropertyElement.GetAttributeReference("pull").Value.ToString();
                                if (binder != null && null != item)
                                {
                                    IBindingItem bindingItem = binder.NewBindingItemInstance();
                                    bindingItem.Source = item.Data;
                                    bindingItem.SourceProperty = pull;
                                    bindingItem.Target = cellControl;
                                    bindingItem.TargetProperty = propertyName;
                                    if (string.IsNullOrEmpty(cellControlName) || propertyName != this.KnownTypes[cellControlName].ReadOnlyProperty)
                                        bindingItem.DefaultValue = defaultValue;
                                    bindingItem.Expression = expression;
                                    binder.BindingItems.Add(bindingItem);
                                    if (item.InvalidMember == bindingItem.SourceProperty)
                                        container.ApplyStyle(invalidStyle);
                                }
                                if (this.IsDesignEnabled && propertyName == this.KnownTypes[cellControlName].WatermarkProperty)
                                {
                                     // StyleTextBox has its own Watermark feature
                                    if (typeof(StyledTextBox).IsInstanceOfType(cellControl))
                                    {
                                        ReflectionServices.SetValue(cellControl, "Watermark", pull);
                                    }
                                    else
                                        container.Attributes.Add("watermark", pull);
                                }
                            }
                        }
                    }
                    result = cellControl;
                }
            }
            return result;
        }
Example #8
0
        /// <devdoc>
        /// </devdoc>
        private void RenderHorizontalRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
        {
            Debug.Assert(outerTableImplied == false, "Cannot use outer implied table with Horizontal layout");

            int itemCount = user.RepeatedItemCount;

            int totalColumns  = repeatColumns;
            int currentColumn = 0;

            if (totalColumns == 0)
            {
                // 0 implies a complete horizontal repetition without any
                // column count constraints
                totalColumns = itemCount;
            }

            WebControl outerControl = null;
            bool       tableLayout  = false;

            switch (repeatLayout)
            {
            case RepeatLayout.Table:
                outerControl = new Table();
                if (Caption.Length != 0)
                {
                    ((Table)outerControl).Caption      = Caption;
                    ((Table)outerControl).CaptionAlign = CaptionAlign;
                }
                tableLayout = true;
                break;

            case RepeatLayout.Flow:
                outerControl = new WebControl(HtmlTextWriterTag.Span);
                break;
            }

            bool separators = user.HasSeparators;

            // use ClientID (and not ID) since we want to render out the fully qualified client id
            // even though this outer control will not be parented to the control hierarchy
            outerControl.ID = baseControl.ClientID;

            outerControl.CopyBaseAttributes(baseControl);
            outerControl.ApplyStyle(controlStyle);
            outerControl.RenderBeginTag(writer);

            if (user.HasHeader)
            {
                if (tableLayout)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                    // add attributes to render for TD/TH
                    if ((totalColumns != 1) || separators)
                    {
                        int columnSpan = totalColumns;
                        if (separators)
                        {
                            columnSpan += totalColumns;
                        }
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, columnSpan.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    if (useAccessibleHeader)
                    {
                        writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                    }

                    // add style attributes to render for TD/TH
                    Style style = user.GetItemStyle(ListItemType.Header, -1);
                    if (style != null)
                    {
                        style.AddAttributesToRender(writer);
                    }

                    // render begin tag
                    if (useAccessibleHeader)
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Th);
                    }
                    else
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    }
                }
                user.RenderItem(ListItemType.Header, -1, this, writer);
                if (tableLayout)
                {
                    // render end tags TD/TH and TR
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
                else
                {
                    if (totalColumns < itemCount)
                    {
                        // we have multiple rows, so have a break between the header and first row.
                        if (EnableLegacyRendering)
                        {
                            writer.WriteObsoleteBreak();
                        }
                        else
                        {
                            writer.WriteBreak();
                        }
                    }
                }
            }

            for (int i = 0; i < itemCount; i++)
            {
                if (tableLayout && (currentColumn == 0))
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                }

                if (tableLayout)
                {
                    // add style attributes to render for TD
                    Style style = user.GetItemStyle(ListItemType.Item, i);
                    if (style != null)
                    {
                        style.AddAttributesToRender(writer);
                    }
                    // render begin tag for TD
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Item, i, this, writer);
                if (tableLayout)
                {
                    // render end tag for TD
                    writer.RenderEndTag();
                }
                if (separators && (i != (itemCount - 1)))
                {
                    if (tableLayout)
                    {
                        Style style = user.GetItemStyle(ListItemType.Separator, i);
                        if (style != null)
                        {
                            style.AddAttributesToRender(writer);
                        }
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    }
                    user.RenderItem(ListItemType.Separator, i, this, writer);
                    if (tableLayout)
                    {
                        writer.RenderEndTag();
                    }
                }

                currentColumn++;

                // on the last line, fill in the rest of the empty spots with <td/>s.
                // If there were separators, we need twice as many plus one to accomodate for
                // the last item not having a separator after it.
                if (tableLayout && i == itemCount - 1)
                {
                    int unfilledColumns = totalColumns - currentColumn;
                    if (separators == true)
                    {
                        int unfilledColumnsWithSeparators = (unfilledColumns * 2) + 1;
                        if (unfilledColumnsWithSeparators > unfilledColumns)
                        {
                            unfilledColumns = unfilledColumnsWithSeparators;
                        }
                    }
                    for (int k = 0; k < unfilledColumns; k++)
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.RenderEndTag();
                    }
                }

                if ((currentColumn == totalColumns) || (i == itemCount - 1))
                {
                    if (tableLayout)
                    {
                        // End tag for TR
                        writer.RenderEndTag();
                    }
                    else
                    {
                        // write out the <br> after rows when there are multiple rows
                        if (totalColumns < itemCount)
                        {
                            if (EnableLegacyRendering)
                            {
                                writer.WriteObsoleteBreak();
                            }
                            else
                            {
                                writer.WriteBreak();
                            }
                        }
                    }

                    currentColumn = 0;
                }
            }

            if (user.HasFooter)
            {
                if (tableLayout)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                    if ((totalColumns != 1) || separators)
                    {
                        // add attributes to render for TD
                        int columnSpan = totalColumns;
                        if (separators)
                        {
                            columnSpan += totalColumns;
                        }
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, columnSpan.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    // add style attributes to render for TD
                    Style style = user.GetItemStyle(ListItemType.Footer, -1);
                    if (style != null)
                    {
                        style.AddAttributesToRender(writer);
                    }
                    // render begin tag for TD
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Footer, -1, this, writer);
                if (tableLayout)
                {
                    // render end tag for TR and TD
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
            }

            outerControl.RenderEndTag(writer);
        }
 private void RenderStyle(HtmlTextWriter writer, WebControl control, string className, MenuItemStyle style, bool applyInlineBorder)
 {
     if (!string.IsNullOrEmpty(className))
     {
         control.CssClass = className;
         if (applyInlineBorder)
         {
             writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, "none");
             writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "1em");
         }
     }
     else if (style != null)
     {
         control.ApplyStyle(style);
     }
 }
Example #10
0
 protected virtual void RenderVerbControl(HtmlTextWriter writer, WebControl control)
 {
     control.ApplyStyle(base.Zone.TitleBarVerbStyle);
     control.Page = base.WebPartManager.Page;
     control.RenderControl(writer);
 }
        /// <devdoc>
        /// </devdoc>
        private void RenderHorizontalRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl) {
            Debug.Assert(outerTableImplied == false, "Cannot use outer implied table with Horizontal layout");

            int itemCount = user.RepeatedItemCount;

            int totalColumns = repeatColumns;
            int currentColumn = 0;

            if (totalColumns == 0) {
                // 0 implies a complete horizontal repetition without any
                // column count constraints
                totalColumns = itemCount;
            }

            WebControl outerControl = null;
            bool tableLayout = false;

            switch (repeatLayout) {
                case RepeatLayout.Table:
                    outerControl = new Table();
                    if (Caption.Length != 0) {
                        ((Table)outerControl).Caption = Caption;
                        ((Table)outerControl).CaptionAlign = CaptionAlign;
                    }
                    tableLayout = true;
                    break;
                case RepeatLayout.Flow:
                    outerControl = new WebControl(HtmlTextWriterTag.Span);
                    break;
            }

            bool separators = user.HasSeparators;

            // use ClientID (and not ID) since we want to render out the fully qualified client id
            // even though this outer control will not be parented to the control hierarchy
            outerControl.ID = baseControl.ClientID;

            outerControl.CopyBaseAttributes(baseControl);
            outerControl.ApplyStyle(controlStyle);
            outerControl.RenderBeginTag(writer);

            if (user.HasHeader) {
                if (tableLayout) {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                    // add attributes to render for TD/TH
                    if ((totalColumns != 1) || separators) {
                        int columnSpan = totalColumns;
                        if (separators)
                            columnSpan += totalColumns;
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, columnSpan.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    if (useAccessibleHeader) {
                        writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                    }

                    // add style attributes to render for TD/TH
                    Style style = user.GetItemStyle(ListItemType.Header, -1);
                    if (style != null) {
                        style.AddAttributesToRender(writer);
                    }

                    // render begin tag
                    if (useAccessibleHeader) {
                        writer.RenderBeginTag(HtmlTextWriterTag.Th);
                    }
                    else {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    }
                }
                user.RenderItem(ListItemType.Header, -1, this, writer);
                if (tableLayout) {
                    // render end tags TD/TH and TR
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
                else {
                    if (totalColumns < itemCount) {
                        // we have multiple rows, so have a break between the header and first row.
                        if (EnableLegacyRendering) {
                            writer.WriteObsoleteBreak();
                        }
                        else {
                            writer.WriteBreak();
                        }
                    }
                }
            }

            for (int i = 0; i < itemCount; i++) {
                if (tableLayout && (currentColumn == 0)) {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                }

                if (tableLayout) {
                    // add style attributes to render for TD
                    Style style = user.GetItemStyle(ListItemType.Item, i);
                    if (style != null)
                        style.AddAttributesToRender(writer);
                    // render begin tag for TD
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Item, i, this, writer);
                if (tableLayout) {
                    // render end tag for TD
                    writer.RenderEndTag();
                }
                if (separators && (i != (itemCount - 1))) {
                    if (tableLayout) {
                        Style style = user.GetItemStyle(ListItemType.Separator, i);
                        if (style != null)
                            style.AddAttributesToRender(writer);
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    }
                    user.RenderItem(ListItemType.Separator, i, this, writer);
                    if (tableLayout)
                        writer.RenderEndTag();
                }

                currentColumn++;
                
                // on the last line, fill in the rest of the empty spots with <td/>s.
                // If there were separators, we need twice as many plus one to accomodate for
                // the last item not having a separator after it.
                if (tableLayout && i == itemCount - 1) {
                    int unfilledColumns = totalColumns - currentColumn;
                    if (separators == true) {
                        int unfilledColumnsWithSeparators = (unfilledColumns * 2) + 1;
                        if (unfilledColumnsWithSeparators > unfilledColumns) {
                            unfilledColumns = unfilledColumnsWithSeparators;
                        }
                    }
                    for (int k = 0; k < unfilledColumns; k++) {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.RenderEndTag();
                    }
                }
                
                if ((currentColumn == totalColumns) || (i == itemCount - 1)) {
                    if (tableLayout) {
                        // End tag for TR
                        writer.RenderEndTag();
                    }
                    else {
                        // write out the <br> after rows when there are multiple rows
                        if (totalColumns < itemCount) {
                            if (EnableLegacyRendering) {
                                writer.WriteObsoleteBreak();
                            }
                            else {
                                writer.WriteBreak();
                            }
                        }
                    }

                    currentColumn = 0;
                }
            }

            if (user.HasFooter) {
                if (tableLayout) {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                    if ((totalColumns != 1) || separators) {
                        // add attributes to render for TD
                        int columnSpan = totalColumns;
                        if (separators)
                            columnSpan += totalColumns;
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, columnSpan.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    // add style attributes to render for TD
                    Style style = user.GetItemStyle(ListItemType.Footer, -1);
                    if (style != null)
                        style.AddAttributesToRender(writer);
                    // render begin tag for TD
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Footer, -1, this, writer);
                if (tableLayout) {
                    // render end tag for TR and TD
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
            }

            outerControl.RenderEndTag(writer);
        }
 private void RenderStyle(HtmlTextWriter writer, WebControl control, string className, MenuItemStyle style, bool applyInlineBorder) {
     if (!String.IsNullOrEmpty(className)) {
         control.CssClass = className;
         if (applyInlineBorder) {
             // Add inline style to force the border to none to override any CssClass (VSWhidbey 336610)
             writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, "none");
             // And an inline font-size of 1em to avoid squaring relative font sizes by applying them twice
             writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "1em");
         }
     }
     else if (style != null) {
         control.ApplyStyle(style);
     }
 }
Example #13
0
        private void RenderHorizontalRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
        {
            int repeatedItemCount = user.RepeatedItemCount;
            int repeatColumns     = this.repeatColumns;
            int num3 = 0;

            if (repeatColumns == 0)
            {
                repeatColumns = repeatedItemCount;
            }
            WebControl control = null;
            bool       flag    = false;

            switch (this.repeatLayout)
            {
            case System.Web.UI.WebControls.RepeatLayout.Table:
                control = new Table();
                if (this.Caption.Length != 0)
                {
                    ((Table)control).Caption      = this.Caption;
                    ((Table)control).CaptionAlign = this.CaptionAlign;
                }
                flag = true;
                break;

            case System.Web.UI.WebControls.RepeatLayout.Flow:
                control = new WebControl(HtmlTextWriterTag.Span);
                break;
            }
            bool hasSeparators = user.HasSeparators;

            control.ID = baseControl.ClientID;
            control.CopyBaseAttributes(baseControl);
            control.ApplyStyle(controlStyle);
            control.RenderBeginTag(writer);
            if (user.HasHeader)
            {
                if (flag)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    if ((repeatColumns != 1) || hasSeparators)
                    {
                        int num4 = repeatColumns;
                        if (hasSeparators)
                        {
                            num4 += repeatColumns;
                        }
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, num4.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    if (this.useAccessibleHeader)
                    {
                        writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                    }
                    Style itemStyle = user.GetItemStyle(ListItemType.Header, -1);
                    if (itemStyle != null)
                    {
                        itemStyle.AddAttributesToRender(writer);
                    }
                    if (this.useAccessibleHeader)
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Th);
                    }
                    else
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    }
                }
                user.RenderItem(ListItemType.Header, -1, this, writer);
                if (flag)
                {
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
                else if (repeatColumns < repeatedItemCount)
                {
                    if (this.EnableLegacyRendering)
                    {
                        writer.WriteObsoleteBreak();
                    }
                    else
                    {
                        writer.WriteBreak();
                    }
                }
            }
            for (int i = 0; i < repeatedItemCount; i++)
            {
                if (flag && (num3 == 0))
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                }
                if (flag)
                {
                    Style style2 = user.GetItemStyle(ListItemType.Item, i);
                    if (style2 != null)
                    {
                        style2.AddAttributesToRender(writer);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Item, i, this, writer);
                if (flag)
                {
                    writer.RenderEndTag();
                }
                if (hasSeparators && (i != (repeatedItemCount - 1)))
                {
                    if (flag)
                    {
                        Style style3 = user.GetItemStyle(ListItemType.Separator, i);
                        if (style3 != null)
                        {
                            style3.AddAttributesToRender(writer);
                        }
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    }
                    user.RenderItem(ListItemType.Separator, i, this, writer);
                    if (flag)
                    {
                        writer.RenderEndTag();
                    }
                }
                num3++;
                if (flag && (i == (repeatedItemCount - 1)))
                {
                    int num6 = repeatColumns - num3;
                    if (hasSeparators)
                    {
                        int num7 = (num6 * 2) + 1;
                        if (num7 > num6)
                        {
                            num6 = num7;
                        }
                    }
                    for (int j = 0; j < num6; j++)
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.RenderEndTag();
                    }
                }
                if ((num3 == repeatColumns) || (i == (repeatedItemCount - 1)))
                {
                    if (flag)
                    {
                        writer.RenderEndTag();
                    }
                    else if (repeatColumns < repeatedItemCount)
                    {
                        if (this.EnableLegacyRendering)
                        {
                            writer.WriteObsoleteBreak();
                        }
                        else
                        {
                            writer.WriteBreak();
                        }
                    }
                    num3 = 0;
                }
            }
            if (user.HasFooter)
            {
                if (flag)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    if ((repeatColumns != 1) || hasSeparators)
                    {
                        int num9 = repeatColumns;
                        if (hasSeparators)
                        {
                            num9 += repeatColumns;
                        }
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, num9.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    Style style4 = user.GetItemStyle(ListItemType.Footer, -1);
                    if (style4 != null)
                    {
                        style4.AddAttributesToRender(writer);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Footer, -1, this, writer);
                if (flag)
                {
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
            }
            control.RenderEndTag(writer);
        }
        private void RenderHorizontalRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
        {
            int repeatedItemCount = user.RepeatedItemCount;
            int repeatColumns = this.repeatColumns;
            int num3 = 0;
            if (repeatColumns == 0)
            {
                repeatColumns = repeatedItemCount;
            }
            WebControl control = null;
            bool flag = false;
            switch (this.repeatLayout)
            {
                case System.Web.UI.WebControls.RepeatLayout.Table:
                    control = new Table();
                    if (this.Caption.Length != 0)
                    {
                        ((Table) control).Caption = this.Caption;
                        ((Table) control).CaptionAlign = this.CaptionAlign;
                    }
                    flag = true;
                    break;

                case System.Web.UI.WebControls.RepeatLayout.Flow:
                    control = new WebControl(HtmlTextWriterTag.Span);
                    break;
            }
            bool hasSeparators = user.HasSeparators;
            control.ID = baseControl.ClientID;
            control.CopyBaseAttributes(baseControl);
            control.ApplyStyle(controlStyle);
            control.RenderBeginTag(writer);
            if (user.HasHeader)
            {
                if (flag)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    if ((repeatColumns != 1) || hasSeparators)
                    {
                        int num4 = repeatColumns;
                        if (hasSeparators)
                        {
                            num4 += repeatColumns;
                        }
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, num4.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    if (this.useAccessibleHeader)
                    {
                        writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                    }
                    Style itemStyle = user.GetItemStyle(ListItemType.Header, -1);
                    if (itemStyle != null)
                    {
                        itemStyle.AddAttributesToRender(writer);
                    }
                    if (this.useAccessibleHeader)
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Th);
                    }
                    else
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    }
                }
                user.RenderItem(ListItemType.Header, -1, this, writer);
                if (flag)
                {
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
                else if (repeatColumns < repeatedItemCount)
                {
                    if (this.EnableLegacyRendering)
                    {
                        writer.WriteObsoleteBreak();
                    }
                    else
                    {
                        writer.WriteBreak();
                    }
                }
            }
            for (int i = 0; i < repeatedItemCount; i++)
            {
                if (flag && (num3 == 0))
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                }
                if (flag)
                {
                    Style style2 = user.GetItemStyle(ListItemType.Item, i);
                    if (style2 != null)
                    {
                        style2.AddAttributesToRender(writer);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Item, i, this, writer);
                if (flag)
                {
                    writer.RenderEndTag();
                }
                if (hasSeparators && (i != (repeatedItemCount - 1)))
                {
                    if (flag)
                    {
                        Style style3 = user.GetItemStyle(ListItemType.Separator, i);
                        if (style3 != null)
                        {
                            style3.AddAttributesToRender(writer);
                        }
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    }
                    user.RenderItem(ListItemType.Separator, i, this, writer);
                    if (flag)
                    {
                        writer.RenderEndTag();
                    }
                }
                num3++;
                if (flag && (i == (repeatedItemCount - 1)))
                {
                    int num6 = repeatColumns - num3;
                    if (hasSeparators)
                    {
                        int num7 = (num6 * 2) + 1;
                        if (num7 > num6)
                        {
                            num6 = num7;
                        }
                    }
                    for (int j = 0; j < num6; j++)
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.RenderEndTag();
                    }
                }
                if ((num3 == repeatColumns) || (i == (repeatedItemCount - 1)))
                {
                    if (flag)
                    {
                        writer.RenderEndTag();
                    }
                    else if (repeatColumns < repeatedItemCount)
                    {
                        if (this.EnableLegacyRendering)
                        {
                            writer.WriteObsoleteBreak();
                        }
                        else
                        {
                            writer.WriteBreak();
                        }
                    }
                    num3 = 0;
                }
            }
            if (user.HasFooter)
            {
                if (flag)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    if ((repeatColumns != 1) || hasSeparators)
                    {
                        int num9 = repeatColumns;
                        if (hasSeparators)
                        {
                            num9 += repeatColumns;
                        }
                        writer.AddAttribute(HtmlTextWriterAttribute.Colspan, num9.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    Style style4 = user.GetItemStyle(ListItemType.Footer, -1);
                    if (style4 != null)
                    {
                        style4.AddAttributesToRender(writer);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                user.RenderItem(ListItemType.Footer, -1, this, writer);
                if (flag)
                {
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
            }
            control.RenderEndTag(writer);
        }