Ejemplo n.º 1
0
        protected override void RenderMenuItem(HtmlTextWriter writer, MenuItem item, bool vertical, bool notLast, bool isFirst, OwnerContext oc)
        {
            Menu   owner           = Owner;
            string clientID        = oc.ClientID;
            bool   displayChildren = owner.DisplayChildren(item);
            bool   dynamicChildren = displayChildren && (item.Depth + 1 >= oc.StaticDisplayLevels);
            bool   isDynamicItem   = IsDynamicItem(owner, item);
            bool   isVertical      = oc.IsVertical || isDynamicItem;
            Unit   itemSpacing     = owner.GetItemSpacing(item, isDynamicItem);

            if (itemSpacing != Unit.Empty && (item.Depth > 0 || !isFirst))
            {
                RenderMenuItemSpacing(writer, itemSpacing, isVertical);
            }

            if (!String.IsNullOrEmpty(item.ToolTip))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Title, item.ToolTip);
            }
            if (isVertical)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            }

            string parentId = isDynamicItem ? "'" + item.Parent.Path + "'" : "null";

            if (dynamicChildren)
            {
                writer.AddAttribute("onmouseover",
                                    "javascript:Menu_OverItem ('" + clientID + "','" + item.Path + "'," + parentId + ")");
                writer.AddAttribute("onmouseout",
                                    "javascript:Menu_OutItem ('" + clientID + "','" + item.Path + "')");
            }
            else if (isDynamicItem)
            {
                writer.AddAttribute("onmouseover",
                                    "javascript:Menu_OverDynamicLeafItem ('" + clientID + "','" + item.Path + "'," + parentId + ")");
                writer.AddAttribute("onmouseout",
                                    "javascript:Menu_OutItem ('" + clientID + "','" + item.Path + "'," + parentId + ")");
            }
            else
            {
                writer.AddAttribute("onmouseover",
                                    "javascript:Menu_OverStaticLeafItem ('" + clientID + "','" + item.Path + "')");
                writer.AddAttribute("onmouseout",
                                    "javascript:Menu_OutItem ('" + clientID + "','" + item.Path + "')");
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            // Top separator image

            if (isDynamicItem)
            {
                RenderSeparatorImage(owner, writer, oc.DynamicTopSeparatorImageUrl, false);
            }
            else
            {
                RenderSeparatorImage(owner, writer, oc.StaticTopSeparatorImageUrl, false);
            }

            // Menu item box

            MenuItemStyle style = new MenuItemStyle();

            if (oc.Header != null)
            {
                // styles are registered
                if (!isDynamicItem && oc.StaticMenuItemStyle != null)
                {
                    AddCssClass(style, oc.StaticMenuItemStyle.CssClass);
                    AddCssClass(style, oc.StaticMenuItemStyle.RegisteredCssClass);
                }
                if (isDynamicItem && oc.DynamicMenuItemStyle != null)
                {
                    AddCssClass(style, oc.DynamicMenuItemStyle.CssClass);
                    AddCssClass(style, oc.DynamicMenuItemStyle.RegisteredCssClass);
                }
                if (oc.LevelMenuItemStyles != null && oc.LevelMenuItemStyles.Count > item.Depth)
                {
                    AddCssClass(style, oc.LevelMenuItemStyles [item.Depth].CssClass);
                    AddCssClass(style, oc.LevelMenuItemStyles [item.Depth].RegisteredCssClass);
                }
                if (item == oc.SelectedItem)
                {
                    if (!isDynamicItem && oc.StaticSelectedStyle != null)
                    {
                        AddCssClass(style, oc.StaticSelectedStyle.CssClass);
                        AddCssClass(style, oc.StaticSelectedStyle.RegisteredCssClass);
                    }
                    if (isDynamicItem && oc.DynamicSelectedStyle != null)
                    {
                        AddCssClass(style, oc.DynamicSelectedStyle.CssClass);
                        AddCssClass(style, oc.DynamicSelectedStyle.RegisteredCssClass);
                    }
                    if (oc.LevelSelectedStyles != null && oc.LevelSelectedStyles.Count > item.Depth)
                    {
                        AddCssClass(style, oc.LevelSelectedStyles [item.Depth].CssClass);
                        AddCssClass(style, oc.LevelSelectedStyles [item.Depth].RegisteredCssClass);
                    }
                }
            }
            else
            {
                // styles are not registered
                if (!isDynamicItem && oc.StaticMenuItemStyle != null)
                {
                    style.CopyFrom(oc.StaticMenuItemStyle);
                }
                if (isDynamicItem && oc.DynamicMenuItemStyle != null)
                {
                    style.CopyFrom(oc.DynamicMenuItemStyle);
                }
                if (oc.LevelMenuItemStyles != null && oc.LevelMenuItemStyles.Count > item.Depth)
                {
                    style.CopyFrom(oc.LevelMenuItemStyles [item.Depth]);
                }
                if (item == oc.SelectedItem)
                {
                    if (!isDynamicItem && oc.StaticSelectedStyle != null)
                    {
                        style.CopyFrom(oc.StaticSelectedStyle);
                    }
                    if (isDynamicItem && oc.DynamicSelectedStyle != null)
                    {
                        style.CopyFrom(oc.DynamicSelectedStyle);
                    }
                    if (oc.LevelSelectedStyles != null && oc.LevelSelectedStyles.Count > item.Depth)
                    {
                        style.CopyFrom(oc.LevelSelectedStyles [item.Depth]);
                    }
                }
            }
            style.AddAttributesToRender(writer);

            writer.AddAttribute("id", GetItemClientId(clientID, item, "i"));
            writer.AddAttribute("cellpadding", "0", false);
            writer.AddAttribute("cellspacing", "0", false);
            writer.AddAttribute("border", "0", false);
            writer.AddAttribute("width", "100%", false);
            writer.RenderBeginTag(HtmlTextWriterTag.Table);
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            // Menu item text

            if (isVertical)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            }
            if (!owner.ItemWrap)
            {
                writer.AddStyleAttribute("white-space", "nowrap");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            RenderItemHref(owner, writer, item);

            Style linkStyle = new Style();

            if (oc.Header != null)
            {
                // styles are registered
                AddCssClass(linkStyle, oc.ControlLinkStyle.RegisteredCssClass);

                if (!isDynamicItem && oc.StaticMenuItemStyle != null)
                {
                    AddCssClass(linkStyle, oc.StaticMenuItemStyle.CssClass);
                    AddCssClass(linkStyle, oc.StaticMenuItemLinkStyle.RegisteredCssClass);
                }
                if (isDynamicItem && oc.DynamicMenuItemStyle != null)
                {
                    AddCssClass(linkStyle, oc.DynamicMenuItemStyle.CssClass);
                    AddCssClass(linkStyle, oc.DynamicMenuItemLinkStyle.RegisteredCssClass);
                }
                if (oc.LevelMenuItemStyles != null && oc.LevelMenuItemStyles.Count > item.Depth)
                {
                    AddCssClass(linkStyle, oc.LevelMenuItemStyles [item.Depth].CssClass);
                    AddCssClass(linkStyle, oc.LevelMenuItemLinkStyles [item.Depth].RegisteredCssClass);
                }
                if (item == oc.SelectedItem)
                {
                    if (!isDynamicItem && oc.StaticSelectedStyle != null)
                    {
                        AddCssClass(linkStyle, oc.StaticSelectedStyle.CssClass);
                        AddCssClass(linkStyle, oc.StaticSelectedLinkStyle.RegisteredCssClass);
                    }
                    if (isDynamicItem && oc.DynamicSelectedStyle != null)
                    {
                        AddCssClass(linkStyle, oc.DynamicSelectedStyle.CssClass);
                        AddCssClass(linkStyle, oc.DynamicSelectedLinkStyle.RegisteredCssClass);
                    }
                    if (oc.LevelSelectedStyles != null && oc.LevelSelectedStyles.Count > item.Depth)
                    {
                        AddCssClass(linkStyle, oc.LevelSelectedStyles [item.Depth].CssClass);
                        AddCssClass(linkStyle, oc.LevelSelectedLinkStyles [item.Depth].RegisteredCssClass);
                    }
                }
            }
            else
            {
                // styles are not registered
                linkStyle.CopyFrom(oc.ControlLinkStyle);

                if (!isDynamicItem && oc.StaticMenuItemStyle != null)
                {
                    linkStyle.CopyFrom(oc.StaticMenuItemLinkStyle);
                }
                if (isDynamicItem && oc.DynamicMenuItemStyle != null)
                {
                    linkStyle.CopyFrom(oc.DynamicMenuItemLinkStyle);
                }
                if (oc.LevelMenuItemStyles != null && oc.LevelMenuItemStyles.Count > item.Depth)
                {
                    linkStyle.CopyFrom(oc.LevelMenuItemLinkStyles [item.Depth]);
                }
                if (item == oc.SelectedItem)
                {
                    if (!isDynamicItem && oc.StaticSelectedStyle != null)
                    {
                        linkStyle.CopyFrom(oc.StaticSelectedLinkStyle);
                    }
                    if (isDynamicItem && oc.DynamicSelectedStyle != null)
                    {
                        linkStyle.CopyFrom(oc.DynamicSelectedLinkStyle);
                    }
                    if (oc.LevelSelectedStyles != null && oc.LevelSelectedStyles.Count > item.Depth)
                    {
                        linkStyle.CopyFrom(oc.LevelSelectedLinkStyles [item.Depth]);
                    }
                }

                linkStyle.AlwaysRenderTextDecoration = true;
            }
            linkStyle.AddAttributesToRender(writer);

            writer.AddAttribute("id", GetItemClientId(clientID, item, "l"));

            if (item.Depth > 0 && !isDynamicItem)
            {
                double value;
#if NET_4_0
                Unit unit = oc.StaticSubMenuIndent;
                if (unit == Unit.Empty)
                {
                    value = 16;
                }
                else
                {
                    value = unit.Value;
                }
#else
                value = oc.StaticSubMenuIndent.Value;
#endif
                Unit indent = new Unit(value * item.Depth, oc.StaticSubMenuIndent.Type);
                writer.AddStyleAttribute(HtmlTextWriterStyle.MarginLeft, indent.ToString());
            }
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            owner.RenderItemContent(writer, item, isDynamicItem);
            writer.RenderEndTag();              // A

            writer.RenderEndTag();              // TD

            // Popup image

            if (dynamicChildren)
            {
                string popOutImage = GetPopOutImage(owner, item, isDynamicItem);
                if (popOutImage != null)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    writer.AddAttribute("src", owner.ResolveClientUrl(popOutImage));
                    writer.AddAttribute("border", "0");
                    string toolTip = String.Format(isDynamicItem ? oc.DynamicPopOutImageTextFormatString : oc.StaticPopOutImageTextFormatString, item.Text);
                    writer.AddAttribute(HtmlTextWriterAttribute.Alt, toolTip);
                    writer.RenderBeginTag(HtmlTextWriterTag.Img);
                    writer.RenderEndTag();                      // IMG
                    writer.RenderEndTag();                      // TD
                }
            }

            writer.RenderEndTag();              // TR
            writer.RenderEndTag();              // TABLE

            writer.RenderEndTag();              // TD

            if (!isVertical && itemSpacing == Unit.Empty && (notLast || (displayChildren && !dynamicChildren)))
            {
                writer.AddStyleAttribute("width", "3px");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.RenderEndTag();
            }

            // Bottom separator image
            string separatorImg = item.SeparatorImageUrl;
            if (separatorImg.Length == 0)
            {
                if (isDynamicItem)
                {
                    separatorImg = oc.DynamicBottomSeparatorImageUrl;
                }
                else
                {
                    separatorImg = oc.StaticBottomSeparatorImageUrl;
                }
            }

            if (separatorImg.Length > 0)
            {
                if (!isVertical)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                }
                RenderSeparatorImage(owner, writer, separatorImg, false);
                if (!isVertical)
                {
                    writer.RenderEndTag();                      // TD
                }
            }

            if (isVertical)
            {
                writer.RenderEndTag();                  // TR
            }
            if (itemSpacing != Unit.Empty)
            {
                RenderMenuItemSpacing(writer, itemSpacing, isVertical);
            }

            // Submenu

            if (displayChildren && !dynamicChildren)
            {
                if (isVertical)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                }
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute("width", "100%");
                owner.RenderMenu(writer, item.ChildItems, vertical, false, item.Depth + 1, notLast);
                if (item.Depth + 2 == oc.StaticDisplayLevels)
                {
                    owner.RenderDynamicMenu(writer, item.ChildItems);
                }
                writer.RenderEndTag();                  // TD
                if (isVertical)
                {
                    writer.RenderEndTag();                      // TR
                }
            }
        }
Ejemplo n.º 2
0
		protected override void RenderMenuItem (HtmlTextWriter writer, MenuItem item, bool vertical, bool notLast, bool isFirst, OwnerContext oc)
		{
			Menu owner = Owner;
			string clientID = oc.ClientID;
			bool displayChildren = owner.DisplayChildren (item);
			bool dynamicChildren = displayChildren && (item.Depth + 1 >= oc.StaticDisplayLevels);
			bool isDynamicItem = IsDynamicItem (owner, item);
			bool isVertical = oc.IsVertical || isDynamicItem;
			Unit itemSpacing = owner.GetItemSpacing (item, isDynamicItem);

			if (itemSpacing != Unit.Empty && (item.Depth > 0 || !isFirst))
				RenderMenuItemSpacing (writer, itemSpacing, isVertical);

			if(!String.IsNullOrEmpty(item.ToolTip))
				writer.AddAttribute (HtmlTextWriterAttribute.Title, item.ToolTip);
			if (isVertical)
				writer.RenderBeginTag (HtmlTextWriterTag.Tr);

			string parentId = isDynamicItem ? "'" + item.Parent.Path + "'" : "null";
			if (dynamicChildren) {
				writer.AddAttribute ("onmouseover",
						     "javascript:Menu_OverItem ('" + clientID + "','" + item.Path + "'," + parentId + ")");
				writer.AddAttribute ("onmouseout",
						     "javascript:Menu_OutItem ('" + clientID + "','" + item.Path + "')");
			} else if (isDynamicItem) {
				writer.AddAttribute ("onmouseover",
						     "javascript:Menu_OverDynamicLeafItem ('" + clientID + "','" + item.Path + "'," + parentId + ")");
				writer.AddAttribute ("onmouseout",
						     "javascript:Menu_OutItem ('" + clientID + "','" + item.Path + "'," + parentId + ")");
			} else {
				writer.AddAttribute ("onmouseover",
						     "javascript:Menu_OverStaticLeafItem ('" + clientID + "','" + item.Path + "')");
				writer.AddAttribute ("onmouseout",
						     "javascript:Menu_OutItem ('" + clientID + "','" + item.Path + "')");
			}

			writer.RenderBeginTag (HtmlTextWriterTag.Td);

			// Top separator image

			if (isDynamicItem)
				RenderSeparatorImage (owner, writer, oc.DynamicTopSeparatorImageUrl, false);
			else
				RenderSeparatorImage (owner, writer, oc.StaticTopSeparatorImageUrl, false);

			// Menu item box
			
			MenuItemStyle style = new MenuItemStyle ();
				
			if (oc.Header != null) {
				// styles are registered
				if (!isDynamicItem && oc.StaticMenuItemStyle != null) {
					AddCssClass (style, oc.StaticMenuItemStyle.CssClass);
					AddCssClass (style, oc.StaticMenuItemStyle.RegisteredCssClass);
				}
				if (isDynamicItem && oc.DynamicMenuItemStyle != null) {
					AddCssClass (style, oc.DynamicMenuItemStyle.CssClass);
					AddCssClass (style, oc.DynamicMenuItemStyle.RegisteredCssClass);
				}
				if (oc.LevelMenuItemStyles != null && oc.LevelMenuItemStyles.Count > item.Depth) {
					AddCssClass (style, oc.LevelMenuItemStyles [item.Depth].CssClass);
					AddCssClass (style, oc.LevelMenuItemStyles [item.Depth].RegisteredCssClass);
				}
				if (item == oc.SelectedItem) {
					if (!isDynamicItem && oc.StaticSelectedStyle != null) {
						AddCssClass (style, oc.StaticSelectedStyle.CssClass);
						AddCssClass (style, oc.StaticSelectedStyle.RegisteredCssClass);
					}
					if (isDynamicItem && oc.DynamicSelectedStyle != null) {
						AddCssClass (style, oc.DynamicSelectedStyle.CssClass);
						AddCssClass (style, oc.DynamicSelectedStyle.RegisteredCssClass);
					}
					if (oc.LevelSelectedStyles != null && oc.LevelSelectedStyles.Count > item.Depth) {
						AddCssClass (style, oc.LevelSelectedStyles [item.Depth].CssClass);
						AddCssClass (style, oc.LevelSelectedStyles [item.Depth].RegisteredCssClass);
					}
				}
			} else {
				// styles are not registered
				if (!isDynamicItem && oc.StaticMenuItemStyle != null)
					style.CopyFrom (oc.StaticMenuItemStyle);
				if (isDynamicItem && oc.DynamicMenuItemStyle != null)
					style.CopyFrom (oc.DynamicMenuItemStyle);
				if (oc.LevelMenuItemStyles != null && oc.LevelMenuItemStyles.Count > item.Depth)
					style.CopyFrom (oc.LevelMenuItemStyles [item.Depth]);
				if (item == oc.SelectedItem) {
					if (!isDynamicItem && oc.StaticSelectedStyle != null)
						style.CopyFrom (oc.StaticSelectedStyle);
					if (isDynamicItem && oc.DynamicSelectedStyle != null)
						style.CopyFrom (oc.DynamicSelectedStyle);
					if (oc.LevelSelectedStyles != null && oc.LevelSelectedStyles.Count > item.Depth)
						style.CopyFrom (oc.LevelSelectedStyles [item.Depth]);
				}
			}
			style.AddAttributesToRender (writer);

			writer.AddAttribute ("id", GetItemClientId (clientID, item, "i"));
			writer.AddAttribute ("cellpadding", "0", false);
			writer.AddAttribute ("cellspacing", "0", false);
			writer.AddAttribute ("border", "0", false);
			writer.AddAttribute ("width", "100%", false);
			writer.RenderBeginTag (HtmlTextWriterTag.Table);
			writer.RenderBeginTag (HtmlTextWriterTag.Tr);

			// Menu item text

			if (isVertical)
				writer.AddStyleAttribute (HtmlTextWriterStyle.Width, "100%");
			if (!owner.ItemWrap)
				writer.AddStyleAttribute ("white-space", "nowrap");
			writer.RenderBeginTag (HtmlTextWriterTag.Td);

			RenderItemHref (owner, writer, item);
			
			Style linkStyle = new Style ();
			if (oc.Header != null) {
				// styles are registered
				AddCssClass (linkStyle, oc.ControlLinkStyle.RegisteredCssClass);

				if (!isDynamicItem && oc.StaticMenuItemStyle != null) {
					AddCssClass (linkStyle, oc.StaticMenuItemStyle.CssClass);
					AddCssClass (linkStyle, oc.StaticMenuItemLinkStyle.RegisteredCssClass);
				}
				if (isDynamicItem && oc.DynamicMenuItemStyle != null) {
					AddCssClass (linkStyle, oc.DynamicMenuItemStyle.CssClass);
					AddCssClass (linkStyle, oc.DynamicMenuItemLinkStyle.RegisteredCssClass);
				}
				if (oc.LevelMenuItemStyles != null && oc.LevelMenuItemStyles.Count > item.Depth) {
					AddCssClass (linkStyle, oc.LevelMenuItemStyles [item.Depth].CssClass);
					AddCssClass (linkStyle, oc.LevelMenuItemLinkStyles [item.Depth].RegisteredCssClass);
				}
				if (item == oc.SelectedItem) {
					if (!isDynamicItem && oc.StaticSelectedStyle != null) {
						AddCssClass (linkStyle, oc.StaticSelectedStyle.CssClass);
						AddCssClass (linkStyle, oc.StaticSelectedLinkStyle.RegisteredCssClass);
					}
					if (isDynamicItem && oc.DynamicSelectedStyle != null) {
						AddCssClass (linkStyle, oc.DynamicSelectedStyle.CssClass);
						AddCssClass (linkStyle, oc.DynamicSelectedLinkStyle.RegisteredCssClass);
					}
					if (oc.LevelSelectedStyles != null && oc.LevelSelectedStyles.Count > item.Depth) {
						AddCssClass (linkStyle, oc.LevelSelectedStyles [item.Depth].CssClass);
						AddCssClass (linkStyle, oc.LevelSelectedLinkStyles [item.Depth].RegisteredCssClass);
					}
				}
			} else {
				// styles are not registered
				linkStyle.CopyFrom (oc.ControlLinkStyle);

				if (!isDynamicItem && oc.StaticMenuItemStyle != null)
					linkStyle.CopyFrom (oc.StaticMenuItemLinkStyle);
				if (isDynamicItem && oc.DynamicMenuItemStyle != null)
					linkStyle.CopyFrom (oc.DynamicMenuItemLinkStyle);
				if (oc.LevelMenuItemStyles != null && oc.LevelMenuItemStyles.Count > item.Depth)
					linkStyle.CopyFrom (oc.LevelMenuItemLinkStyles [item.Depth]);
				if (item == oc.SelectedItem) {
					if (!isDynamicItem && oc.StaticSelectedStyle != null)
						linkStyle.CopyFrom (oc.StaticSelectedLinkStyle);
					if (isDynamicItem && oc.DynamicSelectedStyle != null)
						linkStyle.CopyFrom (oc.DynamicSelectedLinkStyle);
					if (oc.LevelSelectedStyles != null && oc.LevelSelectedStyles.Count > item.Depth)
						linkStyle.CopyFrom (oc.LevelSelectedLinkStyles [item.Depth]);
				}

				linkStyle.AlwaysRenderTextDecoration = true;
			}
			linkStyle.AddAttributesToRender (writer);

			writer.AddAttribute ("id", GetItemClientId (clientID, item, "l"));
			
			if (item.Depth > 0 && !isDynamicItem) {
				double value;
				Unit unit = oc.StaticSubMenuIndent;
				if (unit == Unit.Empty)
					value = 16;
				else
					value = unit.Value;
				Unit indent = new Unit (value * item.Depth, oc.StaticSubMenuIndent.Type);
				writer.AddStyleAttribute (HtmlTextWriterStyle.MarginLeft, indent.ToString ());
			}
			writer.RenderBeginTag (HtmlTextWriterTag.A);
			owner.RenderItemContent (writer, item, isDynamicItem);
			writer.RenderEndTag ();	// A

			writer.RenderEndTag ();	// TD

			// Popup image

			if (dynamicChildren) {
				string popOutImage = GetPopOutImage (owner, item, isDynamicItem);
				if (popOutImage != null) {
					writer.RenderBeginTag (HtmlTextWriterTag.Td);
					writer.AddAttribute ("src", owner.ResolveClientUrl (popOutImage));
					writer.AddAttribute ("border", "0");
					string toolTip = String.Format (isDynamicItem ? oc.DynamicPopOutImageTextFormatString : oc.StaticPopOutImageTextFormatString, item.Text);
					writer.AddAttribute (HtmlTextWriterAttribute.Alt, toolTip);
					writer.RenderBeginTag (HtmlTextWriterTag.Img);
					writer.RenderEndTag ();	// IMG
					writer.RenderEndTag ();	// TD
				}
			}

			writer.RenderEndTag ();	// TR
			writer.RenderEndTag ();	// TABLE
			
			writer.RenderEndTag ();	// TD

			if (!isVertical && itemSpacing == Unit.Empty && (notLast || (displayChildren && !dynamicChildren))) {
				writer.AddStyleAttribute ("width", "3px");
				writer.RenderBeginTag (HtmlTextWriterTag.Td);
				writer.RenderEndTag ();
			}
			
			// Bottom separator image
			string separatorImg = item.SeparatorImageUrl;
			if (separatorImg.Length == 0) {
				if (isDynamicItem)
					separatorImg = oc.DynamicBottomSeparatorImageUrl;
				else
					separatorImg = oc.StaticBottomSeparatorImageUrl;
			}
			
			if (separatorImg.Length > 0) {
				if (!isVertical)
					writer.RenderBeginTag (HtmlTextWriterTag.Td);
				RenderSeparatorImage (owner, writer, separatorImg, false);
				if (!isVertical)
					writer.RenderEndTag (); // TD
			}

			if (isVertical)
				writer.RenderEndTag ();	// TR

			if (itemSpacing != Unit.Empty)
				RenderMenuItemSpacing (writer, itemSpacing, isVertical);

			// Submenu

			if (displayChildren && !dynamicChildren) {
				if (isVertical)
					writer.RenderBeginTag (HtmlTextWriterTag.Tr);
				writer.RenderBeginTag (HtmlTextWriterTag.Td);
				writer.AddAttribute ("width", "100%");
				owner.RenderMenu (writer, item.ChildItems, vertical, false, item.Depth + 1, notLast);
				if (item.Depth + 2 == oc.StaticDisplayLevels)
					owner.RenderDynamicMenu (writer, item.ChildItems);
				writer.RenderEndTag ();	// TD
				if (isVertical)
					writer.RenderEndTag ();	// TR
			}
		}
Ejemplo n.º 3
0
		void RenderMenuItem (HtmlTextWriter writer, MenuItem item, bool notLast, bool isFirst) {
			bool displayChildren = DisplayChildren (item);
			bool dynamicChildren = displayChildren && (item.Depth + 1 >= StaticDisplayLevels);
			bool isDynamicItem = IsDynamicItem (item);
			bool vertical = (Orientation == Orientation.Vertical) || isDynamicItem;
			
			Unit itemSpacing = GetItemSpacing (item, isDynamicItem);

			if (itemSpacing != Unit.Empty && (item.Depth > 0 || !isFirst))
				RenderMenuItemSpacing (writer, itemSpacing, vertical);

			if(!String.IsNullOrEmpty(item.ToolTip))
				writer.AddAttribute (HtmlTextWriterAttribute.Title, item.ToolTip);
			if (vertical)
				writer.RenderBeginTag (HtmlTextWriterTag.Tr);

			string parentId = isDynamicItem ? "'" + item.Parent.Path + "'" : "null";
			if (dynamicChildren) {
				writer.AddAttribute ("onmouseover",
						     "javascript:Menu_OverItem ('" + ClientID + "','" + item.Path + "'," + parentId + ")");
				writer.AddAttribute ("onmouseout",
						     "javascript:Menu_OutItem ('" + ClientID + "','" + item.Path + "')");
			} else if (isDynamicItem) {
				writer.AddAttribute ("onmouseover",
						     "javascript:Menu_OverDynamicLeafItem ('" + ClientID + "','" + item.Path + "'," + parentId + ")");
				writer.AddAttribute ("onmouseout",
						     "javascript:Menu_OutItem ('" + ClientID + "','" + item.Path + "'," + parentId + ")");
			} else {
				writer.AddAttribute ("onmouseover",
						     "javascript:Menu_OverStaticLeafItem ('" + ClientID + "','" + item.Path + "')");
				writer.AddAttribute ("onmouseout",
						     "javascript:Menu_OutItem ('" + ClientID + "','" + item.Path + "')");
			}

			writer.RenderBeginTag (HtmlTextWriterTag.Td);

			// Top separator image

			if (isDynamicItem && DynamicTopSeparatorImageUrl != "") {
				writer.AddAttribute ("src", ResolveClientUrl (DynamicTopSeparatorImageUrl));
				writer.RenderBeginTag (HtmlTextWriterTag.Img);
				writer.RenderEndTag ();	// IMG
			}
			else if (!isDynamicItem && StaticTopSeparatorImageUrl != "") {
				writer.AddAttribute ("src", ResolveClientUrl (StaticTopSeparatorImageUrl));
				writer.RenderBeginTag (HtmlTextWriterTag.Img);
				writer.RenderEndTag ();	// IMG
			}

			// Menu item box
			
			MenuItemStyle style = new MenuItemStyle ();
			if (Page.Header != null) {
				// styles are registered
				if (!isDynamicItem && staticMenuItemStyle != null) {
					AddCssClass (style, staticMenuItemStyle.CssClass);
					AddCssClass (style, staticMenuItemStyle.RegisteredCssClass);
				}
				if (isDynamicItem && dynamicMenuItemStyle != null) {
					AddCssClass (style, dynamicMenuItemStyle.CssClass);
					AddCssClass (style, dynamicMenuItemStyle.RegisteredCssClass);
				}
				if (levelMenuItemStyles != null && levelMenuItemStyles.Count > item.Depth) {
					AddCssClass (style, levelMenuItemStyles [item.Depth].CssClass);
					AddCssClass (style, levelMenuItemStyles [item.Depth].RegisteredCssClass);
				}
				if (item == SelectedItem) {
					if (!isDynamicItem && staticSelectedStyle != null) {
						AddCssClass (style, staticSelectedStyle.CssClass);
						AddCssClass (style, staticSelectedStyle.RegisteredCssClass);
					}
					if (isDynamicItem && dynamicSelectedStyle != null) {
						AddCssClass (style, dynamicSelectedStyle.CssClass);
						AddCssClass (style, dynamicSelectedStyle.RegisteredCssClass);
					}
					if (levelSelectedStyles != null && levelSelectedStyles.Count > item.Depth) {
						AddCssClass (style, levelSelectedStyles [item.Depth].CssClass);
						AddCssClass (style, levelSelectedStyles [item.Depth].RegisteredCssClass);
					}
				}
			}
			else {
				// styles are not registered
				if (!isDynamicItem && staticMenuItemStyle != null) {
					style.CopyFrom (staticMenuItemStyle);
				}
				if (isDynamicItem && dynamicMenuItemStyle != null) {
					style.CopyFrom (dynamicMenuItemStyle);
				}
				if (levelMenuItemStyles != null && levelMenuItemStyles.Count > item.Depth) {
					style.CopyFrom (levelMenuItemStyles [item.Depth]);
				}
				if (item == SelectedItem) {
					if (!isDynamicItem && staticSelectedStyle != null) {
						style.CopyFrom (staticSelectedStyle);
					}
					if (isDynamicItem && dynamicSelectedStyle != null) {
						style.CopyFrom (dynamicSelectedStyle);
					}
					if (levelSelectedStyles != null && levelSelectedStyles.Count > item.Depth) {
						style.CopyFrom (levelSelectedStyles [item.Depth]);
					}
				}
			}
			style.AddAttributesToRender (writer);

			writer.AddAttribute ("id", GetItemClientId (item, "i"));

			writer.AddAttribute ("cellpadding", "0", false);
			writer.AddAttribute ("cellspacing", "0", false);
			writer.AddAttribute ("border", "0", false);
			writer.AddAttribute ("width", "100%", false);
			writer.RenderBeginTag (HtmlTextWriterTag.Table);
			writer.RenderBeginTag (HtmlTextWriterTag.Tr);

			// Menu item text

			if (vertical)
				writer.AddStyleAttribute (HtmlTextWriterStyle.Width, "100%");
			if (!ItemWrap)
				writer.AddStyleAttribute ("white-space", "nowrap");
			writer.RenderBeginTag (HtmlTextWriterTag.Td);

			RenderItemHref (writer, item);
			
			Style linkStyle = new Style ();
			if (Page.Header != null) {
				// styles are registered
				AddCssClass (linkStyle, ControlLinkStyle.RegisteredCssClass);

				if (!isDynamicItem && staticMenuItemStyle != null) {
					AddCssClass (linkStyle, staticMenuItemStyle.CssClass);
					AddCssClass (linkStyle, staticMenuItemLinkStyle.RegisteredCssClass);
				}
				if (isDynamicItem && dynamicMenuItemStyle != null) {
					AddCssClass (linkStyle, dynamicMenuItemStyle.CssClass);
					AddCssClass (linkStyle, dynamicMenuItemLinkStyle.RegisteredCssClass);
				}
				if (levelMenuItemStyles != null && levelMenuItemStyles.Count > item.Depth) {
					AddCssClass (linkStyle, levelMenuItemStyles [item.Depth].CssClass);
					AddCssClass (linkStyle, levelMenuItemLinkStyles [item.Depth].RegisteredCssClass);
				}
				if (item == SelectedItem) {
					if (!isDynamicItem && staticSelectedStyle != null) {
						AddCssClass (linkStyle, staticSelectedStyle.CssClass);
						AddCssClass (linkStyle, staticSelectedLinkStyle.RegisteredCssClass);
					}
					if (isDynamicItem && dynamicSelectedStyle != null) {
						AddCssClass (linkStyle, dynamicSelectedStyle.CssClass);
						AddCssClass (linkStyle, dynamicSelectedLinkStyle.RegisteredCssClass);
					}
					if (levelSelectedStyles != null && levelSelectedStyles.Count > item.Depth) {
						AddCssClass (linkStyle, levelSelectedStyles [item.Depth].CssClass);
						AddCssClass (linkStyle, levelSelectedLinkStyles [item.Depth].RegisteredCssClass);
					}
				}
			}
			else {
				// styles are not registered
				linkStyle.CopyFrom (ControlLinkStyle);

				if (!isDynamicItem && staticMenuItemStyle != null) {
					linkStyle.CopyFrom (staticMenuItemLinkStyle);
				}
				if (isDynamicItem && dynamicMenuItemStyle != null) {
					linkStyle.CopyFrom (dynamicMenuItemLinkStyle);
				}
				if (levelMenuItemStyles != null && levelMenuItemStyles.Count > item.Depth) {
					linkStyle.CopyFrom (levelMenuItemLinkStyles [item.Depth]);
				}
				if (item == SelectedItem) {
					if (!isDynamicItem && staticSelectedStyle != null) {
						linkStyle.CopyFrom (staticSelectedLinkStyle);
					}
					if (isDynamicItem && dynamicSelectedStyle != null) {
						linkStyle.CopyFrom (dynamicSelectedLinkStyle);
					}
					if (levelSelectedStyles != null && levelSelectedStyles.Count > item.Depth) {
						linkStyle.CopyFrom (levelSelectedLinkStyles [item.Depth]);
					}
				}

				linkStyle.AlwaysRenderTextDecoration = true;
			}
			linkStyle.AddAttributesToRender (writer);

			writer.AddAttribute ("id", GetItemClientId (item, "l"));
			
			if (item.Depth > 0 && !isDynamicItem) {
				Unit indent = new Unit (StaticSubMenuIndent.Value * item.Depth, StaticSubMenuIndent.Type);
				writer.AddStyleAttribute ("margin-left", indent.ToString ());
			}
			writer.RenderBeginTag (HtmlTextWriterTag.A);
			RenderItemContent (writer, item, isDynamicItem);
			writer.RenderEndTag ();	// A

			writer.RenderEndTag ();	// TD

			// Popup image

			if (dynamicChildren) {
				string popOutImage = GetPopOutImage (item, isDynamicItem);
				if (popOutImage != null) {
					writer.RenderBeginTag (HtmlTextWriterTag.Td);
					writer.AddAttribute ("src", ResolveClientUrl (popOutImage));
					writer.AddAttribute ("border", "0");
					string toolTip = String.Format (isDynamicItem ? DynamicPopOutImageTextFormatString : StaticPopOutImageTextFormatString, item.Text);
					writer.AddAttribute (HtmlTextWriterAttribute.Alt, toolTip);
					writer.RenderBeginTag (HtmlTextWriterTag.Img);
					writer.RenderEndTag ();	// IMG
					writer.RenderEndTag ();	// TD
				}
			}

			writer.RenderEndTag ();	// TR
			writer.RenderEndTag ();	// TABLE
			
			writer.RenderEndTag ();	// TD

			if (!vertical && itemSpacing == Unit.Empty && (notLast || (displayChildren && !dynamicChildren))) {
				writer.AddStyleAttribute ("width", "3px");
				writer.RenderBeginTag (HtmlTextWriterTag.Td);
				writer.RenderEndTag ();
			}
			
			// Bottom separator image
			string separatorImg = item.SeparatorImageUrl;
			if (separatorImg.Length == 0) {
				if (isDynamicItem)
					separatorImg = DynamicBottomSeparatorImageUrl;
				else
					separatorImg = StaticBottomSeparatorImageUrl;
			}
			if (separatorImg.Length > 0) {
				if (!vertical)
					writer.RenderBeginTag (HtmlTextWriterTag.Td);
				writer.AddAttribute ("src", ResolveClientUrl (separatorImg));
				writer.RenderBeginTag (HtmlTextWriterTag.Img);
				writer.RenderEndTag ();	// IMG
				if (!vertical)
					writer.RenderEndTag (); // TD
			}

			if (vertical)
				writer.RenderEndTag ();	// TR

			if (itemSpacing != Unit.Empty)
				RenderMenuItemSpacing (writer, itemSpacing, vertical);

			// Submenu

			if (displayChildren && !dynamicChildren) {
				if (vertical)
					writer.RenderBeginTag (HtmlTextWriterTag.Tr);
				writer.RenderBeginTag (HtmlTextWriterTag.Td);
				writer.AddAttribute ("width", "100%");
				RenderMenu (writer, item.ChildItems, Orientation == Orientation.Vertical, false, item.Depth + 1, notLast);
				if (item.Depth + 2 == StaticDisplayLevels)
					RenderDynamicMenu (writer, item.ChildItems);
				writer.RenderEndTag ();	// TD
				if (vertical)
					writer.RenderEndTag ();	// TR
			}

		}
Ejemplo n.º 4
0
        internal void RenderItem(HtmlTextWriter writer, int position, bool enabled, Orientation orientation, bool staticOnly)
        {
            enabled = enabled && this.Enabled;
            int           depth         = this.Depth;
            MenuItemStyle menuItemStyle = this._owner.GetMenuItemStyle(this);
            int           num2          = this.Depth + 1;
            bool          flag          = (depth < this._owner.StaticDisplayLevels) && (this._owner.StaticTopSeparatorImageUrl.Length != 0);
            bool          flag2         = (depth >= this._owner.StaticDisplayLevels) && (this._owner.DynamicTopSeparatorImageUrl.Length != 0);

            if (flag || flag2)
            {
                if (orientation == Orientation.Vertical)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                }
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                if (flag)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Src, this._owner.ResolveClientUrl(this._owner.StaticTopSeparatorImageUrl));
                }
                else
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Src, this._owner.ResolveClientUrl(this._owner.DynamicTopSeparatorImageUrl));
                }
                writer.AddAttribute(HtmlTextWriterAttribute.Alt, string.Empty);
                writer.RenderBeginTag(HtmlTextWriterTag.Img);
                writer.RenderEndTag();
                writer.RenderEndTag();
                if (orientation == Orientation.Vertical)
                {
                    writer.RenderEndTag();
                }
            }
            if (((menuItemStyle != null) && !menuItemStyle.ItemSpacing.IsEmpty) && ((depth != 0) || (position != 0)))
            {
                this.RenderItemSpacing(writer, menuItemStyle.ItemSpacing, orientation);
            }
            if (!staticOnly && this._owner.Enabled)
            {
                if (num2 > this._owner.StaticDisplayLevels)
                {
                    if ((this.Selectable && this.Enabled) || (this.ChildItems.Count != 0))
                    {
                        writer.AddAttribute("onmouseover", "Menu_HoverDynamic(this)");
                        this.RenderItemEvents(writer);
                    }
                    else
                    {
                        writer.AddAttribute("onmouseover", "Menu_HoverDisabled(this)");
                        writer.AddAttribute("onmouseout", "Menu_Unhover(this)");
                    }
                }
                else if (num2 == this._owner.StaticDisplayLevels)
                {
                    if ((this.Selectable && this.Enabled) || (this.ChildItems.Count != 0))
                    {
                        writer.AddAttribute("onmouseover", "Menu_HoverStatic(this)");
                        this.RenderItemEvents(writer);
                    }
                }
                else if (this.Selectable && this.Enabled)
                {
                    writer.AddAttribute("onmouseover", "Menu_HoverRoot(this)");
                    this.RenderItemEvents(writer);
                }
            }
            if (this.ToolTip.Length != 0)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Title, this.ToolTip);
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.Id);
            if (orientation == Orientation.Vertical)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            if ((this._owner.Page != null) && this._owner.Page.SupportsStyleSheets)
            {
                string cssClassName = this._owner.GetCssClassName(this, false);
                if (cssClassName.Trim().Length > 0)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClassName);
                }
            }
            else if (menuItemStyle != null)
            {
                menuItemStyle.AddAttributesToRender(writer);
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Width, "100%");
            writer.RenderBeginTag(HtmlTextWriterTag.Table);
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            if (!this._owner.ItemWrap)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
            }
            if (orientation == Orientation.Vertical)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            if ((this._owner.Page != null) && this._owner.Page.SupportsStyleSheets)
            {
                bool   flag3;
                string str2 = this._owner.GetCssClassName(this, true, out flag3);
                if (str2.Trim().Length > 0)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, str2);
                    if (flag3)
                    {
                        writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, "none");
                        writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "1em");
                    }
                }
            }
            else if (menuItemStyle != null)
            {
                menuItemStyle.HyperLinkStyle.AddAttributesToRender(writer);
            }
            string accessKey = this._owner.AccessKey;

            if (enabled && this.Selectable)
            {
                if (this.NavigateUrl.Length > 0)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Href, this._owner.ResolveClientUrl(this.NavigateUrl));
                    string target = this.ViewState["Target"] as string;
                    if (target == null)
                    {
                        target = this._owner.Target;
                    }
                    if (target.Length > 0)
                    {
                        writer.AddAttribute(HtmlTextWriterAttribute.Target, target);
                    }
                }
                else
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Href, this._owner.Page.ClientScript.GetPostBackClientHyperlink(this._owner, this.InternalValuePath, true, true));
                }
                if (!this._owner.AccessKeyRendered && (accessKey.Length != 0))
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, accessKey, true);
                    this._owner.AccessKeyRendered = true;
                }
            }
            else if (!enabled)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "true");
            }
            else if ((this.ChildItems.Count != 0) && (num2 >= this._owner.StaticDisplayLevels))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                writer.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "text");
                if (!this._owner.AccessKeyRendered && (accessKey.Length != 0))
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, accessKey, true);
                    this._owner.AccessKeyRendered = true;
                }
            }
            if ((depth != 0) && (depth < this._owner.StaticDisplayLevels))
            {
                Unit staticSubMenuIndent = this._owner.StaticSubMenuIndent;
                if (staticSubMenuIndent.IsEmpty)
                {
                    staticSubMenuIndent = Unit.Pixel(0x10);
                }
                if (staticSubMenuIndent.Value != 0.0)
                {
                    double num3 = staticSubMenuIndent.Value * depth;
                    if (num3 < 32767.0)
                    {
                        staticSubMenuIndent = new Unit(num3, staticSubMenuIndent.Type);
                    }
                    else
                    {
                        staticSubMenuIndent = new Unit(32767.0, staticSubMenuIndent.Type);
                    }
                    writer.AddStyleAttribute("margin-left", staticSubMenuIndent.ToString(CultureInfo.InvariantCulture));
                }
            }
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            if ((this.ImageUrl.Length > 0) && this.NotTemplated())
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Src, this._owner.ResolveClientUrl(this.ImageUrl));
                writer.AddAttribute(HtmlTextWriterAttribute.Alt, this.ToolTip);
                writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, "none");
                writer.AddStyleAttribute("vertical-align", "middle");
                writer.RenderBeginTag(HtmlTextWriterTag.Img);
                writer.RenderEndTag();
            }
            this.RenderText(writer);
            writer.RenderEndTag();
            bool   flag4 = (num2 >= this._owner.StaticDisplayLevels) && (num2 < this._owner.MaximumDepth);
            string str5  = flag4 ? this.GetExpandImageUrl() : string.Empty;
            bool   flag5 = false;

            if ((((orientation == Orientation.Horizontal) && (depth < this._owner.StaticDisplayLevels)) && (!flag4 || (str5.Length == 0))) && ((menuItemStyle == null) || menuItemStyle.ItemSpacing.IsEmpty))
            {
                if (((this.Depth + 1) < this._owner.StaticDisplayLevels) && (this.ChildItems.Count != 0))
                {
                    flag5 = true;
                }
                else
                {
                    for (MenuItem item = this; item != null; item = item.Parent)
                    {
                        if ((((item.Parent == null) && (this._owner.Items.Count != 0)) && (item != this._owner.Items[this._owner.Items.Count - 1])) || (((item.Parent != null) && (item.Parent.ChildItems.Count != 0)) && (item != item.Parent.ChildItems[item.Parent.ChildItems.Count - 1])))
                        {
                            flag5 = true;
                            break;
                        }
                    }
                }
            }
            writer.RenderEndTag();
            if (flag4 && (str5.Length > 0))
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "0");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute(HtmlTextWriterAttribute.Src, str5);
                writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, "none");
                writer.AddStyleAttribute(HtmlTextWriterStyle.VerticalAlign, "middle");
                if (depth < this._owner.StaticDisplayLevels)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Alt, string.Format(CultureInfo.CurrentCulture, this._owner.StaticPopOutImageTextFormatString, new object[] { this.Text }));
                }
                else if (depth >= this._owner.StaticDisplayLevels)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Alt, string.Format(CultureInfo.CurrentCulture, this._owner.DynamicPopOutImageTextFormatString, new object[] { this.Text }));
                }
                writer.RenderBeginTag(HtmlTextWriterTag.Img);
                writer.RenderEndTag();
                writer.RenderEndTag();
            }
            writer.RenderEndTag();
            writer.RenderEndTag();
            writer.RenderEndTag();
            if (orientation == Orientation.Vertical)
            {
                writer.RenderEndTag();
            }
            if ((menuItemStyle != null) && !menuItemStyle.ItemSpacing.IsEmpty)
            {
                this.RenderItemSpacing(writer, menuItemStyle.ItemSpacing, orientation);
            }
            else if (flag5)
            {
                this.RenderItemSpacing(writer, HorizontalDefaultSpacing, orientation);
            }
            bool flag6 = this.SeparatorImageUrl.Length != 0;
            bool flag7 = (depth < this._owner.StaticDisplayLevels) && (this._owner.StaticBottomSeparatorImageUrl.Length != 0);
            bool flag8 = (depth >= this._owner.StaticDisplayLevels) && (this._owner.DynamicBottomSeparatorImageUrl.Length != 0);

            if ((flag6 || flag7) || flag8)
            {
                if (orientation == Orientation.Vertical)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                }
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                if (flag6)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Src, this._owner.ResolveClientUrl(this.SeparatorImageUrl));
                }
                else if (flag7)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Src, this._owner.ResolveClientUrl(this._owner.StaticBottomSeparatorImageUrl));
                }
                else
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Src, this._owner.ResolveClientUrl(this._owner.DynamicBottomSeparatorImageUrl));
                }
                writer.AddAttribute(HtmlTextWriterAttribute.Alt, string.Empty);
                writer.RenderBeginTag(HtmlTextWriterTag.Img);
                writer.RenderEndTag();
                writer.RenderEndTag();
                if (orientation == Orientation.Vertical)
                {
                    writer.RenderEndTag();
                }
            }
        }