Ejemplo n.º 1
0
        /// <summary>
        /// Render rootCatalog control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void Render(HtmlTextWriter output)
        {
//			if(this._cached)
//			{
            output.Write(MenuCacheControl.GetMenu(this._catalogID, this._linkFormat).Output);
//			}
//			else
//			{
            // Change the selected item if it doesn't match the current clips item id
//				if(_menu.SelectedItem != null && _menu.SelectedItem.ID != _clipID.ToString())
//					recurseSelection(_menu);
//
//				_menu.RenderControl(output);
//			}
        }
Ejemplo n.º 2
0
        protected override void CreateChildControls()
        {
            if (MenuCacheControl.MenuExists(this._catalogID, this._linkFormat))
            {
                _cached = true;
            }
            else
            {
                _menu = new ComponentArt.Web.UI.Menu();

                _menu.ID                      = this.ID + "_menu";
                _menu.CssClass                = "TopGroup";
                _menu.EnableViewState         = false;
                _menu.Orientation             = GroupOrientation.Vertical;
                _menu.DefaultGroupCssClass    = "MenuGroup";
                _menu.DefaultGroupItemSpacing = 1;
                _menu.ImagesBaseUrl           = "~/";
                _menu.EnableViewState         = false;
                _menu.Width                   = _width;
//				_menu.ClientScriptLocation = "~/componentart_webui_client";

                // Create default Item Look
                ItemLook itmLook = new ItemLook();
                itmLook.LookId             = "MenuItem";
                itmLook.CssClass           = "MenuItem";
                itmLook.HoverCssClass      = "MenuItemHover";
                itmLook.ActiveCssClass     = "MenuItemDown";
                itmLook.ExpandedCssClass   = "MenuItemDown";
                itmLook.LabelPaddingLeft   = Unit.Pixel(5);
                itmLook.LabelPaddingRight  = Unit.Pixel(15);
                itmLook.LabelPaddingTop    = Unit.Pixel(2);
                itmLook.LabelPaddingBottom = Unit.Pixel(2);

                _menu.ItemLooks.Add(itmLook);

                _menu.DefaultItemLookId = "MenuItem";

                Controls.Add(_menu);
            }

            ChildControlsCreated = true;
        }
Ejemplo n.º 3
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            EnsureChildControls();

            // Cached menus are already Loaded
            if (_cached)
            {
                return;
            }

            DbContentCatalog        rootCatalog;
            DbContentClipCollection rootCatalogClips;
            CssInfo rootCssInfo;

            // Load the catalog to start building a menu from
            rootCatalog      = new DbContentCatalog(_catalogID);
            rootCatalogClips = rootCatalog.GetClips();
            rootCatalogClips.Sort(ContentCompareKey.MenuOrder);

            // Set menu css to catalog css properties
            rootCssInfo = new CssInfo(rootCatalog.MenuCssClass);
            rootCssInfo.SetLook(_menu);

            DbContentCatalogCollection catalogs = rootCatalog.GetCatalogs();

            catalogs.Sort(ContentCompareKey.MenuOrder);

            for (int catalogIndex = 0; catalogIndex < catalogs.Count; catalogIndex++)
            {
                addCatalogToMenu(_menu.Items, rootCatalog, catalogs[catalogIndex]);
            }

            addClipsToMenu(_menu.Items, rootCatalog, rootCatalog, rootCatalogClips);

            _menu.Width = _width;

            MenuCacheControl.SetMenu(_catalogID, _linkFormat, _menu);
        }