Наследование: System.Web.UI.WebControls.HierarchicalDataBoundControl, IPostBackEventHandler, INamingContainer
Пример #1
0
        public override string GetDesignTimeHtml()
        {
            try
            {
                System.Web.UI.WebControls.Menu viewControl = (System.Web.UI.WebControls.Menu)base.ViewControl;
                ListDictionary data = new ListDictionary();
                data.Add("DesignTimeTextWriterType", typeof(DesignTimeHtmlTextWriter));
                ((IControlDesignerAccessor)base.ViewControl).SetDesignModeState(data);
                int maximumDynamicDisplayLevels = viewControl.MaximumDynamicDisplayLevels;
                if (maximumDynamicDisplayLevels > 10)
                {
                    viewControl.MaximumDynamicDisplayLevels = 10;
                }
                this.DataBind((BaseDataBoundControl)base.ViewControl);
                IDictionary designModeState = ((IControlDesignerAccessor)base.ViewControl).GetDesignModeState();
                switch (this._currentView)
                {
                case ViewType.Static:
                    return((string)designModeState["GetDesignTimeStaticHtml"]);

                case ViewType.Dynamic:
                    return((string)designModeState["GetDesignTimeDynamicHtml"]);
                }
                if (maximumDynamicDisplayLevels > 10)
                {
                    viewControl.MaximumDynamicDisplayLevels = maximumDynamicDisplayLevels;
                }
                return(base.GetDesignTimeHtml());
            }
            catch (Exception exception)
            {
                return(this.GetErrorDesignTimeHtml(exception));
            }
        }
Пример #2
0
        //==========================================================================================
        // This method is wired to the OnPreRender setting of the menu control on this page.
        //==========================================================================================
        protected void CheckSelectedNode(object sender, EventArgs e)
        {
            System.Web.UI.WebControls.Menu mnu = (System.Web.UI.WebControls.Menu)sender;
            MenuItem ancestor = mnu.SelectedItem;   // on initial assignment "ancestor" name makes no sense.

            // ----------------------------------------------------
            // First item of business is fill the report drop down
            //-----------------------------------------------------
            FillReports(ancestor);

            //=====================================================
            // Algorithm depends on the Root not having a title.
            // This shows up using the Text property.
            //=====================================================
            while (ancestor != null)
            {
                ancestor = ancestor.Parent as MenuItem;
                if (ancestor != null && ancestor.Text.Length > 0)
                {
                    if (ancestor.Selectable)
                    {
                        ancestor.Selected = true;
                    }
                }
                else
                {
                    ancestor = null;
                }
            }

            foreach (MenuItem itm in mnu.Items)
            {
                HideToolTip(itm);
            }
        }
        protected void setMenuData()
        {
            Menu menu = new Menu();
            MenuItem item;

            item = new MenuItem();
            item.Text = "Home Page";
            item.Value = "valueHomePage";
            menu.Items.Add(item);
            item = null;

            item = new MenuItem();
            item.Text = "Contact Us";
            item.Value = "valueContactUs";
            menu.Items.Add(item);
            item = null;

            item = new MenuItem();
            item.Text = "Productions";
            item.Value = "valueProductions";
            menu.Items.Add(item);
            item = null;

            item = new MenuItem();
            item.Text = "Compare";
            item.Value = "valueCompare";
            menu.Items.Add(item);
            item = null;

            item = new MenuItem();
            item.Text = "Links";
            item.Value = "valueLinks";
            menu.Items.Add(item);
            item = null;
        }
Пример #4
0
            public MenuSampleData(System.Web.UI.WebControls.Menu menu, int depth, string path)
            {
                this._menu = menu;
                int num = this._menu.StaticDisplayLevels + this._menu.MaximumDynamicDisplayLevels;

                if ((num < this._menu.StaticDisplayLevels) || (num < this._menu.MaximumDynamicDisplayLevels))
                {
                    num = 0x7fffffff;
                }
                if (depth == 0)
                {
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleRoot"), depth, path, false));
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleRoot"), depth, path));
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleRoot"), depth, path, false));
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleRoot"), depth, path, false));
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleRoot"), depth, path, false));
                }
                else if ((depth <= this._menu.StaticDisplayLevels) && (depth < 10))
                {
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleParent", new object[] { depth }), depth, path));
                }
                else if ((depth < num) && (depth < 10))
                {
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleLeaf", new object[] { 1 }), depth, path));
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleLeaf", new object[] { 2 }), depth, path));
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleLeaf", new object[] { 3 }), depth, path));
                    this._list.Add(new MenuDesigner.MenuSampleDataNode(this._menu, System.Design.SR.GetString("HierarchicalDataBoundControlDesigner_SampleLeaf", new object[] { 4 }), depth, path));
                }
            }
    protected void Menu1_MenuItemDataBound(object sender, MenuEventArgs e)
    {
        if (!Page.IsCallback)
        {
            System.Web.UI.WebControls.Menu menu = (System.Web.UI.WebControls.Menu)sender;
            SiteMapNode mapNode = (SiteMapNode)e.Item.DataItem;

            bool bEsMiembro = false;

            foreach (string RolMenu in mapNode.Roles)
            {
                if (RolMenu == "*")
                {
                    if (mapNode.Title == "Reconexión" && Session["PERFIL"].ToString() != "A")
                    {
                        bEsMiembro = false;
                    }
                    else
                    {
                        bEsMiembro = true;
                    }
                    break;
                }
                string RolMenuAux = RolMenu.Trim();
                if (RolMenuAux != "")
                {
                    foreach (string MiRol in ((RolePrincipal)Page.User).GetRoles())
                    {
                        if (RolMenu == MiRol)
                        {
                            bEsMiembro = true;
                            break;
                        }
                    }
                }
                if (bEsMiembro)
                {
                    break;
                }
            }

            if (!bEsMiembro)
            {
                System.Web.UI.WebControls.MenuItem itemToRemove = menu.FindItem(mapNode.Title);

                if (e.Item.Depth == 0)
                {
                    menu.Items.Remove(e.Item);
                }
                else
                {
                    System.Web.UI.WebControls.MenuItem parent = e.Item.Parent;
                    if (parent != null)
                    {
                        parent.ChildItems.Remove(e.Item);
                    }
                }
            }
        }
    }
Пример #6
0
 public override void Initialize(IComponent component)
 {
     ControlDesigner.VerifyInitializeArgument(component, typeof(System.Web.UI.WebControls.Menu));
     base.Initialize(component);
     this._menu = (System.Web.UI.WebControls.Menu)component;
     base.SetViewFlags(ViewFlags.TemplateEditing, true);
 }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     util   = new Utilerias();
     BO     = new BO.CatalogManager();
     mpMenu = (System.Web.UI.WebControls.Menu)Master.FindControl("ChildrenMenu");
     mpMenu.MenuItemClick += new MenuEventHandler(menuCatalog_MenuItemClick);
 }
Пример #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     util   = new Utilerias();
     mpMenu = (System.Web.UI.WebControls.Menu)Master.FindControl("ChildrenMenu");
     mpMenu.MenuItemClick += new MenuEventHandler(menuSolicitud_MenuItemClick);
     try
     {
         MenuSelected(Request.QueryString["mod"]);
         if (ViewState["Comando"] != null)
         {
             if (ViewState["Comando"].ToString() == "repOperArea")
             {
                 Datos_v1();
             }
             else
             {
                 Datos_v2();
             }
         }
     }
     catch (Exception ex)
     {
         //Response.Redirect("Services/Logout.ashx");
     }
 }
Пример #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     util   = new Utilerias();
     mpMenu = (System.Web.UI.WebControls.Menu)Master.FindControl("ChildrenMenu");
     mpMenu.MenuItemClick += new MenuEventHandler(menuSolicitud_MenuItemClick);
     try
     {
         if (Request.QueryString["ex"] != null)
         {
             if (!Page.IsPostBack)
             {
                 lblIdExchange.Text = Request.QueryString["ex"];
                 var swap = new PartListExchangeManager();
                 ddlPartListC.DataSource = swap.GetPartListC(Request.QueryString["ex"]);
                 ddlPartListC.DataBind();
                 Quote();
             }
         }
         else
         {
             Response.Redirect(UrlReference + "?mod=imAddReq");
         }
     }
     catch (Exception ex)
     {
         //Response.Redirect("Services/Logout.ashx");
     }
 }
Пример #10
0
        private void ArbolMenuRaizASP(DataRowCollection filas, ref System.Web.UI.WebControls.Menu menu)
        {
            bool ConHijos = false;

            foreach (System.Data.DataRow fila in filas)
            {
                MenuItem hijo = new MenuItem();

                hijo.Text = fila["Descripcion"].ToString();

                if (fila["Url"].ToString() != "..")
                {
                    hijo.NavigateUrl = fila["Url"].ToString();
                }

                if (fila.IsNull("MenuPadre_Id") & fila["Visible"].ToString() == "True")
                {
                    ArbolMenuNodoASP(fila.GetChildRows("NodeRelation"), ref hijo, ref ConHijos);
                    if (ConHijos)
                    {
                        menu.Items.Add(hijo);
                    }
                }
            }
        }
Пример #11
0
        protected void Volunteer_MenuItemClick(object sender, MenuEventArgs e)
        {
            System.Web.UI.WebControls.Menu Volunteer = sender as System.Web.UI.WebControls.Menu;
            MultiView multiTabs = this.FindControl("VolunteerView") as MultiView;

            multiTabs.ActiveViewIndex = Int32.Parse(MasterMenu.SelectedValue);
        }
Пример #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     util = new Utilerias();
     wndRequerimiento.OpenerElementID = imbRequerimiento.ClientID;
     wndDocumentos.OpenerElementID    = imbDocs.ClientID;
     mpMenu = (System.Web.UI.WebControls.Menu)Master.FindControl("ChildrenMenu");
     mpMenu.MenuItemClick += new MenuEventHandler(menuSolicitud_MenuItemClick);
     try
     {
         if (Request.QueryString["page"] == null)
         {
             ViewState["UrlReference"] = "Solicitud.aspx";
         }
         else
         {
             ViewState["UrlReference"] = "ExchangeNote.aspx";
         }
         if (!Page.IsPostBack)
         {
             lblIdExchange.Text = Request.QueryString["ex"];
             string url = ViewState["UrlReference"].ToString().Substring(0, ViewState["UrlReference"].ToString().IndexOf('.'));
             wndRequerimiento.NavigateUrl = "Mobile/Requerimiento.aspx?ex=" + Request.QueryString["ex"] + "&mod=" + url;
             wndDocumentos.NavigateUrl    = "Services/Soporte.aspx?ex=" + Request.QueryString["ex"] + "&mod=" + url;
             MenuSelected(Request.QueryString["mod"], int.Parse(Request.QueryString["ex"]));
         }
     }
     catch (ArgumentNullException ex)
     {
         Alert.Denegado(this.Page);
     }
     catch (Exception ex)
     {
         //Response.Redirect("Services/Logout.ashx");
     }
 }
Пример #13
0
        protected void CoordinatorMenu_MenuItemClick(object sender, MenuEventArgs e)
        {
            System.Web.UI.WebControls.Menu CoordinatorMenu = sender as System.Web.UI.WebControls.Menu;
            MultiView multiTabs = this.FindControl("CoordinatorMultiView") as MultiView;

            multiTabs.ActiveViewIndex = Int32.Parse(CoordinatorMenu.SelectedValue);
        }
Пример #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     util = new Utilerias();
     wndRequerimiento.OpenerElementID = imbRequerimiento.ClientID;
     wndDocumentos.OpenerElementID    = imbDocs.ClientID;
     mpMenu = (System.Web.UI.WebControls.Menu)Master.FindControl("ChildrenMenu");
     mpMenu.MenuItemClick += new MenuEventHandler(menuSolicitud_MenuItemClick);
     try
     {
         if (!Page.IsPostBack)
         {
             calLimitDate.SelectedDate      = DateTime.Today;
             calAplicationDate.SelectedDate = DateTime.Today;
             if (Request.QueryString["mod"] != null && Request.QueryString["ex"] != null)
             {
                 wndRequerimiento.NavigateUrl = "Mobile/Requerimiento.aspx?ex=" + Request.QueryString["ex"] + "&mod=ExchangeNote";
                 wndDocumentos.NavigateUrl    = "Services/Soporte.aspx?ex=" + Request.QueryString["ex"];
                 selectedExchange(int.Parse(Request.QueryString["ex"]));
                 MenuSelected(Request.QueryString["mod"], int.Parse(Request.QueryString["ex"]));
             }
             else
             {
                 MenuSelected(mpMenu.Items[0].Value, 0);
             }
         }
     }
     catch (ArgumentNullException ex)
     {
         Alert.Denegado(this.Page);
     }
     catch (Exception ex)
     {
         //Response.Redirect("Services/Logout.ashx");
     }
 }
Пример #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     util   = new Utilerias();
     mpMenu = (System.Web.UI.WebControls.Menu)Master.FindControl("ChildrenMenu");
     mpMenu.MenuItemClick += new MenuEventHandler(menuReporte_MenuItemClick);
     try
     {
         if (!Page.IsPostBack)
         {
             wndRequerimiento.NavigateUrl = "Mobile/Requerimiento.aspx?ex=" + Request.QueryString["ex"] + "&mod=" +
                                            Master.Page.Request.Url.Segments[
                 Master.Page.Request.Url.Segments.Length - 1];
             MenuSelected(Request.QueryString["mod"]);
             var ex = new DS.SAI.Business.ExchangeManager();
             gvExchange.DataSource = ex.GetExchangePDF(string.Empty, string.Empty, string.Empty, dtOpR1.SelectedDate,
                                                       dtOpR2.SelectedDate);
             gvExchange.DataBind();
         }
     }
     catch (ArgumentNullException ex)
     {
         Alert.Denegado(this.Page);
     }
     catch (Exception ex)
     {
         //Response.Redirect("Services/Logout.ashx");
     }
 }
Пример #16
0
	protected void Page_Load(object sender, EventArgs e)
	{
		util = new Utilerias();
        mpMenu = (System.Web.UI.WebControls.Menu)Master.FindControl("ChildrenMenu");
        mpMenu.MenuItemClick += new MenuEventHandler(menuSolicitud_MenuItemClick);
		try
		{
			if (Request.QueryString["page"] == null)
					ViewState["UrlReference"] = "Solicitud.aspx";
				else
					ViewState["UrlReference"] = "ExchangeNote.aspx";
			if (Request.QueryString["ex"] == null)
				Response.Redirect(ViewState["UrlReference"].ToString() + "?mod=imAddReq");
			else
			{
				if (!Page.IsPostBack)
				{
					lblIdExchange.Text = Request.QueryString["ex"];
				}
			}
		}
		catch (ArgumentNullException ex)
		{
			Alert.Denegado(this.Page);
		}
		catch (Exception ex)
		{
			//Response.Redirect("Services/Logout.ashx");
		}
	}
Пример #17
0
        protected void menuTabsCurrent_MenuItemClick(object sender, MenuEventArgs e)
        {
            System.Web.UI.WebControls.Menu menuTabsCurrent = sender as System.Web.UI.WebControls.Menu;
            MultiView multiTabs = this.FindControl("multiviewStudent") as MultiView;

            multiTabs.ActiveViewIndex = Int32.Parse(menuTabsCurrent.SelectedValue);
        }
Пример #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ASPMenu menu = (ASPMenu)this.Master.FindControl("NavigationMenu");

            //menu.Visible = false;
            PopulateMenu();
        }
Пример #19
0
 public MenuSampleDataNode(System.Web.UI.WebControls.Menu menu, string text, int depth, string path, bool hasChildren)
 {
     this._text        = text;
     this._depth       = depth;
     this._path        = path + '\\' + text;
     this._menu        = menu;
     this._hasChildren = hasChildren;
 }
Пример #20
0
 public void Setup()
 {
     _accountsHomePage        = new AccountsHomePage();
     _accountsHomePagePrivate = new PrivateObject(_accountsHomePage);
     _siteMapSecondLevelField = new SiteMapDataSource();
     _menuField    = new Menu();
     _shimsContext = ShimsContext.Create();
     InitializeFields();
 }
Пример #21
0
 protected override void DataBind(BaseDataBoundControl dataBoundControl)
 {
     System.Web.UI.WebControls.Menu menu = (System.Web.UI.WebControls.Menu)dataBoundControl;
     if (((menu.DataSourceID != null) && (menu.DataSourceID.Length > 0)) || ((menu.DataSource != null) || (menu.Items.Count == 0)))
     {
         menu.Items.Clear();
         base.DataBind(menu);
     }
 }
Пример #22
0
        public void GenerateUserPreferenceTestMenu(ASPMenu navigationMenu)
        {
            navigationMenu.Items.Clear();
            GenerateMenuStyle();
            var listUPMenu = SessionVariables.UserPreferedMenuData;

            if (listUPMenu != null && listUPMenu.Count > 0)
            {
                var parentMenus = listUPMenu
                                  .Where(t => t.ParentMenuId == null)
                                  .Select(t => t)
                                  .OrderBy(t => t.SortOrder);

                MenuItem helpMenuItem = null;

                foreach (var objMenu in parentMenus)
                {
                    var menuDisplayName = objMenu.MenuDisplayName;
                    var menuText        = menuDisplayName;

                    if (SessionVariables.IsTesting && !string.IsNullOrEmpty(objMenu.PrimaryDeveloper))
                    {
                        menuText += " (" + objMenu.PrimaryDeveloper + ")";
                    }

                    var menuItem = new MenuItem(menuText);
                    menuItem.Value = objMenu.MenuId.ToString();

                    GenerateUserPreferenceTestChildMenus(menuItem, listUPMenu);

                    navigationMenu.CssClass = "app-main-menu";

                    menuItem.NavigateUrl = MenuHelper.GetMenuItemUrl(objMenu);

                    if (menuItem.NavigateUrl == "#" && menuItem.ChildItems.Count > 0)
                    {
                        menuItem.NavigateUrl = menuItem.ChildItems[0].NavigateUrl;
                    }

                    if (menuDisplayName.ToLower() == "help")
                    {
                        AddFixedMenus(menuItem);
                        helpMenuItem = menuItem;
                        continue;
                    }

                    navigationMenu.Items.Add(menuItem);
                }

                // if help menu is present add it last
                if (helpMenuItem != null)
                {
                    navigationMenu.Items.Add(helpMenuItem);
                }
            }
        }
Пример #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Menu navbar = new Menu(nav);
        if (!Page.IsPostBack)
        {
             dt = conec.Productos();
             DataList1.DataSource = dt;
             DataList1.DataBind();
        }
 }
Пример #24
0
    private void CreateMainMenu(System.Web.UI.WebControls.Menu objMenu)
    {
        dcUTWDataContext dc = new dcUTWDataContext();
        var mnus            = dc.Menus.Where(p => p.State == true && p.Parent == 0).Take(10);

        foreach (var mnuItem in mnus)
        {
            objMenu.Items.Add(createMenuItem(mnuItem.Title, mnuItem.ID.ToString(), mnuItem.Url));
        }
    }
Пример #25
0
        //DataTable dt = new DataTable();
        protected void Page_Load(object sender, EventArgs e)
        {
            Menu navbar = new Menu(nav);

               //if (!Page.IsPostBack)
               //{
               //dt = conec.Carrito();
               //GridView1.DataSource = dt;
               //GridView1.DataBind();
               //}
        }
Пример #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        util = new Utilerias();
        try
        {
            mpMenu = (System.Web.UI.WebControls.Menu)Master.FindControl("ChildrenMenu");
            mpMenu.MenuItemClick += new MenuEventHandler(menuSolicitud_MenuItemClick);
            if (!Page.IsPostBack)
            {
                if (Request.QueryString["page"] == null)
                {
                    ViewState["UrlReference"] = "Solicitud.aspx";
                }
                else
                {
                    ViewState["UrlReference"] = "ExchangeNote.aspx";
                }
            }
            if (Request.QueryString["ex"] != null)
            {
                if (!Page.IsPostBack)
                {
                    lblIdExchange.Text = Request.QueryString["ex"];
                    if ((Request.QueryString["mod"] != null) && (Request.QueryString["mod"] == "imTiming"))
                    {
                        chlTaskNext.Checked = false;
                        ddlNestTask.Enabled = chlTaskNext.Checked;
                        TaskExchange();

                        RadMultiPage1.SelectedIndex = 0;
                    }
                    if ((Request.QueryString["mod"] != null) && (Request.QueryString["mod"] == "imManAut"))
                    {
                        lblTitle.Text = "Autorización de Gerencia";
                        LoadAutorizacion();
                        RadMultiPage1.SelectedIndex = 1;
                    }
                }
            }
            else
            {
                Response.Redirect(ViewState["UrlReference"].ToString() + "?mod=imAddReq");
            }
        }
        catch (ArgumentNullException ex)
        {
            Alert.Denegado(this.Page);
        }
        catch (Exception ex)
        {
            //Response.Redirect("Services/Logout.ashx");
        }
    }
 public MenuBindingsEditorForm(IServiceProvider serviceProvider, System.Web.UI.WebControls.Menu menu, MenuDesigner menuDesigner) : base(serviceProvider)
 {
     this._menu = menu;
     this.InitializeComponent();
     this.InitializeUI();
     foreach (MenuItemBinding binding in this._menu.DataBindings)
     {
         MenuItemBinding clone = (MenuItemBinding) ((ICloneable) binding).Clone();
         menuDesigner.RegisterClone(binding, clone);
         this._bindingsListView.Items.Add(clone);
     }
 }
Пример #28
0
        protected void MasterMenu_MenuItemClick(object sender, MenuEventArgs e)
        {
            System.Web.UI.WebControls.Menu MasterMenu = sender as System.Web.UI.WebControls.Menu;
            MultiView multiTabs = this.FindControl("MasterMultiView") as MultiView;

            //MessageBox.Show(UserLoginType + Int32.Parse(MasterMenu.SelectedValue));

            MasterMultiView.ActiveViewIndex = Int32.Parse(MasterMenu.SelectedValue);

            //ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "ShowMessage('Not Authorized to Access this page!','Warning');", true);
            //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "modalLoginForm", "$('#modalLoginForm').modal();", true);
        }
 public MenuBindingsEditorForm(IServiceProvider serviceProvider, System.Web.UI.WebControls.Menu menu, MenuDesigner menuDesigner) : base(serviceProvider)
 {
     this._menu = menu;
     this.InitializeComponent();
     this.InitializeUI();
     foreach (MenuItemBinding binding in this._menu.DataBindings)
     {
         MenuItemBinding clone = (MenuItemBinding)((ICloneable)binding).Clone();
         menuDesigner.RegisterClone(binding, clone);
         this._bindingsListView.Items.Add(clone);
     }
 }
Пример #30
0
    private void CreateChildMenu(System.Web.UI.WebControls.Menu mnuMain)
    {
        dcUTWDataContext dc = new dcUTWDataContext();
        var mnus            = dc.Menus.Where(p => p.State == true && p.Parent != 0);

        foreach (var mnu in mnus)
        {
            int nMenuID = getMenuID(mnu.Parent.ToString(), mnuMain);
            if (nMenuID > -1)
            {
                mnuMain.Items[nMenuID].ChildItems.Add(createMenuItem(mnu.Title, mnu.ID.ToString(), mnu.Url));
            }
        }
    }
Пример #31
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Models.PoliklinikEntities4 p=new Models.PoliklinikEntities4();

            var res = from c in p.UrunKategori select new {Adi = c.Adi };
            Menu m = new Menu();
            foreach (var item in res.ToList())
            {
             MenuItem l=new MenuItem();
                l.Value=item.Adi;
                m.Items.Add(l);
                Menu1.Items.Add(l);
            }
        }
Пример #32
0
 protected void Page_Load(object sender, EventArgs e)
 {
     util = new Utilerias();
     try
     {
         Usuario.Value = BO.SecurityManager.ObtenerUsuario(HttpContext.Current).IdUsuario.ToString();
         gridMessage.DataBind();
         gridMessage.Rebind();
         mpMenu = (System.Web.UI.WebControls.Menu)Master.FindControl("ChildrenMenu");
     }
     catch (Exception ex)
     {
         //Response.Redirect("Services/Logout.ashx");
     }
 }
Пример #33
0
    /// <summary>
    /// ئاساسى تىزىملىكنىڭ نۇمۇرىنى ئېلىش
    /// </summary>
    /// <param name="strValue">قىممىتى</param>
    /// <param name="objMenu">تىزىملىك ئوبىكتى</param>
    /// <returns>پۈتۈن سان- تىزىملىك تەرتىپ نۇمۇرى</returns>
    private int getMenuID(string strValue, System.Web.UI.WebControls.Menu objMenu)
    {
        string sValue  = strValue.Trim();
        int    intTemp = -1;

        for (int intFor = 0; intFor < objMenu.Items.Count; intFor++)
        {
            if (objMenu.Items[intFor].Value == sValue)
            {
                intTemp = intFor;
                break;
            }
        }
        return(intTemp);
    }
Пример #34
0
 protected void bindMenuProLb(Menu MenuProLb)
 {
     SQLHelper.Setup();
     List<DXLb> lbs = SQLHelper.GetEntities<DXLb>(" IsDeleted=0 AND parentid = 0 Order By OrderId");
     foreach (DXLb lb in lbs)
     {
         MenuItem menuNode = new MenuItem();
         menuNode.Text = lb.LbName;
         menuNode.Value = lb.Id.ToString();
         menuNode.NavigateUrl = "Prod.aspx?lbid=" + lb.Id;
         menuNode.Enabled = true;
         MenuProLb.Items.Add(menuNode);
         parentid_ = lb.Id;
         addChildMenu(menuNode);
     }
 }
Пример #35
0
        public Resultado <MenuInfo> CargarMenuASP(ref System.Web.UI.WebControls.Menu rdMenu, UsuarioInfo Entidad)
        {
            DataSet   dsPadres = new DataSet();
            DataTable dt       = new DataTable();
            DataRow   dr;
            var       ObjetoResultado = new Resultado <MenuInfo>();


            ObjetoResultado = AccesoDatos.Buscar <MenuInfo, UsuarioInfo>(Entidad, Documental.Data.Global.SP.MenuUsuario_QRY);

            dt.Columns.Add("Id");
            dt.Columns.Add("MenuPadre_Id");
            dt.Columns.Add("Descripcion");
            dt.Columns.Add("Url");
            dt.Columns.Add("Nivel");
            dt.Columns.Add("Visible");
            dt.Columns.Add("Orden");

            try
            {
                foreach (MenuInfo ObjetoMenu in ObjetoResultado.Lista)
                {
                    dr                 = dt.NewRow();
                    dr["Id"]           = ObjetoMenu.Id;
                    dr["MenuPadre_Id"] = ObjetoMenu.MenuPadre_Id;
                    dr["Descripcion"]  = ObjetoMenu.Descripcion;
                    dr["Url"]          = ObjetoMenu.Url;
                    dr["Nivel"]        = ObjetoMenu.Nivel;
                    dr["Visible"]      = ObjetoMenu.Visible;
                    dr["Orden"]        = ObjetoMenu.Orden;
                    dt.Rows.Add(dr);
                }

                dsPadres.Tables.Add(dt);

                dsPadres.Relations.Add("NodeRelation", dsPadres.Tables[0].Columns["Id"], dsPadres.Tables[0].Columns["MenuPadre_Id"]);
                ArbolMenuRaizASP(dsPadres.Tables[0].Rows, ref rdMenu);
            }
            catch (Exception ex)
            {
                ObjetoResultado.Mensaje          = ex.Message;
                ObjetoResultado.ResultadoGeneral = false;
            }
            return(ObjetoResultado);
        }
    /// Filter the data to get only the rows that have a
    /// null ParentID (This will come on the top-level menu items)

    private void AddTopMenuItems(DataTable menuData, System.Web.UI.WebControls.Menu applicationMenu)
    {
        DataView view = new DataView(menuData);

        view.RowFilter = "ParentId = 0";

        // Create an instance.


        //  this.Menu1.Items.Clear();

        foreach (DataRowView row in view)
        {
            MenuItem newMenuItem = new MenuItem(row["Text"].ToString());
            newMenuItem.Value       = row["MenuId"].ToString();
            newMenuItem.NavigateUrl = row["NavigateUrl"].ToString();
            applicationMenu.Items.Add(newMenuItem);
            AddChildMenuItems(menuData, newMenuItem);
            //if (!string.IsNullOrEmpty(newMenuItem.NavigateUrl))
            //    Response.Redirect(newMenuItem.NavigateUrl, true);

            //Added by saravanan on 05112012
            // checking whether logged in user have rights to view the page or not
            if (row["NavigateUrl"].ToString().Contains("?"))
            {
                if (Page.Request.AppRelativeCurrentExecutionFilePath.ToString() == row["NavigateUrl"].ToString().Substring(0, row["NavigateUrl"].ToString().IndexOf("?")))
                {
                    Isallowed = true;
                }
            }
            else
            {
                if (Page.Request.AppRelativeCurrentExecutionFilePath.ToString() == row["NavigateUrl"].ToString())
                {
                    Isallowed = true;
                }
            }
        }
    }
Пример #37
0
        private void SetearOpcionesConsultor(Menu menuPrincipal)
        {
            SetearOpcionesGeneral(menuPrincipal);

            menuPrincipal.Items.Remove(menuPrincipal.FindItem("Cliente"));

            // Buscar el item Vehiculo
            MenuItem menuVehiculo = menuPrincipal.FindItem("Vehiculo");

            // Buscar cada subitem del item Vehiculo
            MenuItem venderVehiculo = menuPrincipal.FindItem("Vehiculo/VenderVehiculo");
            MenuItem registrarVehiculo = menuPrincipal.FindItem("Vehiculo/RegistrarVehiculo");
            MenuItem modificarVehiculo = menuPrincipal.FindItem("Vehiculo/ModificarVehiculo");
            MenuItem caracteristicasVehiculo = menuPrincipal.FindItem("Vehiculo/CaracteristicasVehiculo");
            MenuItem eliminarVehiculo = menuPrincipal.FindItem("Vehiculo/EliminarVehiculo");

            // Eliminar cada subitem del item Vehiculo
            menuVehiculo.ChildItems.Remove(venderVehiculo);
            menuVehiculo.ChildItems.Remove(registrarVehiculo);
            menuVehiculo.ChildItems.Remove(modificarVehiculo);
            menuVehiculo.ChildItems.Remove(caracteristicasVehiculo);
            menuVehiculo.ChildItems.Remove(eliminarVehiculo);
        }
Пример #38
0
		public void RenderSeparatorImage (Menu owner, HtmlTextWriter writer, string url, bool standardsCompliant)
		{
			if (String.IsNullOrEmpty (url))
				return;
			
			writer.AddAttribute (HtmlTextWriterAttribute.Src, owner.ResolveClientUrl (url));
			if (standardsCompliant) {
				writer.AddAttribute (HtmlTextWriterAttribute.Alt, String.Empty);
				writer.AddAttribute (HtmlTextWriterAttribute.Class, "separator");
			}
			
			writer.RenderBeginTag (HtmlTextWriterTag.Img);
			writer.RenderEndTag ();
		}
Пример #39
0
		public string GetArrowResourceUrl (Menu owner) 
		{
			Page page = owner.Page;
			ClientScriptManager csm = page != null ? page.ClientScript : null;
			if (csm != null)
				return csm.GetWebResourceUrl (typeof (Menu), "arrow_plus.gif");

			return null;
		}
Пример #40
0
		public string GetPopOutImage (Menu owner, MenuItem item, bool isDynamicItem)
		{
			if (owner == null)
				owner = Owner;
			
			if (item.PopOutImageUrl != String.Empty)
				return item.PopOutImageUrl;

			bool needArrowResource = false;
			if (isDynamicItem) {
				if (owner.DynamicPopOutImageUrl != String.Empty)
					return owner.DynamicPopOutImageUrl;
				if (owner.DynamicEnableDefaultPopOutImage)
					needArrowResource = true;		
			} else {
				if (owner.StaticPopOutImageUrl != String.Empty)
					return owner.StaticPopOutImageUrl;
				if (owner.StaticEnableDefaultPopOutImage)
					needArrowResource = true;
			}

			if (needArrowResource)
				return GetArrowResourceUrl (owner);
			
			return null;
		}
Пример #41
0
		public virtual void RenderItemHref (Menu owner, HtmlTextWriter writer, MenuItem item)
		{
			if (!item.BranchEnabled)
				writer.AddAttribute ("disabled", "true", false);
			else if (!item.Selectable) {
				writer.AddAttribute ("href", "#", false);
				writer.AddStyleAttribute ("cursor", "text");
			} else if (item.NavigateUrl != String.Empty) {
				string target = item.Target != String.Empty ? item.Target : owner.Target;
				string navUrl = owner.ResolveClientUrl (item.NavigateUrl);
				writer.AddAttribute ("href", navUrl);
				if (target != String.Empty)
					writer.AddAttribute ("target", target);
			} else
				writer.AddAttribute ("href", GetClientEvent (owner, item));
		}
Пример #42
0
 public void SetMenuItem(Menu menu, string itemText)
 {
     if (menu != null)
     {
         if (menu.SelectedItem == null)
         {
             foreach (MenuItem item in menu.Items)
             {
                 if (itemText.Equals(item.Text))
                 {
                     item.Selected = true;
                 }
             }
         }
     }
 }
 internal MenuItemBindingCollection(Menu owner) {
     _owner = owner;
 }
Пример #44
0
		void SetDataBindings (Menu menu) {
			MenuItemBinding b = new MenuItemBinding ();
			b.DataMember = "node";
			b.EnabledField = "enabled";
			b.Enabled = false;
			b.ImageUrlField = "img";
			b.ImageUrl = "img#default";
			b.NavigateUrlField = "url";
			b.NavigateUrl = "url#default";
			b.PopOutImageUrlField = "popoutimg";
			b.PopOutImageUrl = "popoutimg#default";
			b.SelectableField = "selectable";
			b.Selectable = false;
			b.SeparatorImageUrlField = "separatorimg";
			b.SeparatorImageUrl = "separatorimg#default";
			b.TargetField = "target";
			b.Target = "target#default";
			b.FormatString = "text#{0}";
			b.TextField = "text";
			b.Text = "text#default";
			b.ToolTipField = "tooltip";
			b.ToolTip = "tooltip#default";
			b.ValueField = "value";
			b.Value = "value#default";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "root";
			b.Enabled = false;
			b.ImageUrl = "img#root";
			b.NavigateUrl = "url#root";
			b.PopOutImageUrl = "popoutimg#root";
			b.Selectable = false;
			b.SeparatorImageUrl = "separatorimg#root";
			b.Target = "target#root";
			b.Text = "text#root";
			b.ToolTip = "tooltip#root";
			b.Value = "value#root";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra1";
			b.Text = "text#extra1";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra2";
			b.Value = "value#extra2";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra3";
			b.TextField = "text";
			b.ValueField = "value";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra4";
			b.TextField = "text";
			b.Text = "text#default";
			b.ValueField = "value";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra5";
			b.TextField = "text";
			b.Value = "value#default";
			b.ValueField = "value";
			menu.DataBindings.Add (b);
		}
Пример #45
0
		private static void fillMenu (Menu m) {
			m.Items.Clear ();
			m.Items.Add (new MenuItem ());
			m.Items [0].ChildItems.Add (new MenuItem ());
			m.Items [0].ChildItems.Add (new MenuItem ());
			m.Items [0].ChildItems [0].ChildItems.Add (new MenuItem ());
		}
Пример #46
0
		string GetClientEvent (Menu owner, MenuItem item)
		{
			if (owner == null)
				owner = Owner;

			Page page = owner.Page;
			ClientScriptManager csm = page != null ? page.ClientScript : null;

			if (csm == null)
				return String.Empty;
			
			return csm.GetPostBackClientHyperlink (owner, item.Path, true);
		}
Пример #47
0
 private void SetearOpcionesGeneral(Menu menuPrincipal)
 {
     // Remover los items que no son accesibles por el usuario
     menuPrincipal.Items.Remove(menuPrincipal.FindItem("Empleado"));
     menuPrincipal.Items.Remove(menuPrincipal.FindItem("Comision"));
 }
Пример #48
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Menu navbar = new Menu(nav);
 }
Пример #49
0
		public MenuTableRenderer (Menu owner)
			: base (owner)
		{
		}
Пример #50
0
		public override bool IsDynamicItem (Menu owner, MenuItem item)
		{
			if (owner == null)
				throw new ArgumentNullException ("owner");

			if (item == null)
				throw new ArgumentNullException ("item");
			
			return item.Depth + 1 > owner.StaticDisplayLevels;
		}
        static void Main(string[] args)
        {
            var dinnerMenu = new DinnerMenu();
            var breakfastMenu = new BreakfastMenu();
            var  cafeMenu = new CafeMenu();

            MenuComponent breakfastCMenu = new Menu("PANCAKE HOUSE", "Breakfast");
            MenuComponent dinnerCMenu = new Menu("FINE DINING ITALIAN", "Dinner");
            MenuComponent coffeeCMenu = new Menu("THE TEA HOSE", "Tea Time");
            MenuComponent foodCourtMenu = new Menu("THE FOOD COURT - 24 Hours", "All day food");

            foodCourtMenu.add(breakfastCMenu);
            foodCourtMenu.add(dinnerCMenu);
            foodCourtMenu.add(coffeeCMenu);

            MenuItem pasta = new MenuItem(5, "Lunch: Pasta", "Pasta", false);
            MenuItem soup = new MenuItem(10, "Lunch: Soup", "Soup", true);
            MenuItem salad = new MenuItem(15, "Lunch: Salda", "Salda", true);

            MenuItem tea = new MenuItem(6, "Tea Time: Tea", "Tea", true);
            MenuItem biscuit = new MenuItem(9, "Tea Time: Biscuit", "Biscuit", false);
            MenuItem cake = new MenuItem(12, "Tea Time: Cake", "Cake", false);

            MenuItem coffee = new MenuItem(11, "Breakfast: Coffee", "Coffee", true);
            MenuItem fruit = new MenuItem(22, "Breakfast: Fruit", "Fruit", true);
            MenuItem muesly = new MenuItem(33, "Breakfast: Muesly", "Muesly", false);

            breakfastCMenu.add(coffee);
            breakfastCMenu.add(fruit);
            breakfastCMenu.add(muesly);

            dinnerCMenu.add(pasta);
            dinnerCMenu.add(soup);
            dinnerCMenu.add(salad);

            coffeeCMenu.add(tea);
            coffeeCMenu.add(biscuit);
            coffeeCMenu.add(cake);

            WaitressComposite superWaittress = new WaitressComposite(foodCourtMenu);

            superWaittress.printMenu();

            Console.ReadLine();

            var javaWaitress = new JavaWaitressIterator(breakfastMenu, dinnerMenu, cafeMenu);

            var dinnerOrderId = javaWaitress.AddMenu(dinnerMenu);
            var breakfastOrderId = javaWaitress.AddMenu(breakfastMenu);
            var cafeOrderId = javaWaitress.AddMenu(cafeMenu);

            javaWaitress.PrintOrder(dinnerOrderId);
            javaWaitress.PrintOrder(breakfastOrderId);
            javaWaitress.PrintOrder(cafeOrderId);

            javaWaitress.PrintOrders();

            javaWaitress.PrintOrdersWithIterators();

            Console.ReadLine();

            return;

            Console.WriteLine("Testing New Cafe Menu added");

            javaWaitress.printCafeMenu_WithEnumerator();

            javaWaitress.printCafeMenu_WithIterator();

            Console.ReadLine();
            return;

            Console.WriteLine("\nPrinting BREAKFAST MENU_____________________");
            javaWaitress.printBreakfastMenu_WithEnumerator();

            Console.WriteLine("\nPrinting LUNCH MENU_____________________");
            javaWaitress.printDinnerMenu_WithEnumerator();

            Console.WriteLine("\nPrinting ALL menu_____________________");
            javaWaitress.printMenu();

            Console.WriteLine("\nPrinting vegetarian dishes_____________________");

            Console.WriteLine("Item {0} is vegetarian: {1}", "Set A", javaWaitress.isItemVegetarian("Set A"));
            Console.WriteLine("Item {0} is vegetarian: {1}", "Set B", javaWaitress.isItemVegetarian("Set B"));
            Console.WriteLine("Item {0} is vegetarian: {1}", "Set C", javaWaitress.isItemVegetarian("Set C"));
            Console.WriteLine("Item {0} is vegetarian: {1}", "Set D", javaWaitress.isItemVegetarian("Set D"));

            Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set A", javaWaitress.isItemVegetarian("Dinner Set A"));
            Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set B", javaWaitress.isItemVegetarian("Dinner Set B"));
            Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set C", javaWaitress.isItemVegetarian("Dinner Set C"));
            Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set D", javaWaitress.isItemVegetarian("Dinner Set D"));

            Console.ReadLine();
        }
Пример #52
0
 /// <summary>
 /// Menus the build.
 /// </summary>
 /// <param name="navigationMenu">The navigation menu.</param>
 /// <param name="objItemList">The object item list.</param>
 private void MenuBuild(Menu navigationMenu, IList<IMenuContainer> objItemList)
 {
     navigationMenu.Items.Clear();
     var menuItems = new List<MenuItem>();
     this.FactorialRecursion(objItemList, menuItems, null, -1);
     foreach (var item in menuItems)
     {
         navigationMenu.Items.Add(item);
     }
 }
Пример #53
0
		private static void AddMenuToPage (Page p, Menu m) {
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			p.Form.Controls.Add (lcb);
			p.Form.Controls.Add (m);
			p.Form.Controls.Add (lce);
		}
Пример #54
0
        /// <devdoc>
        ///     Sets the owner Menu of this item.
        /// </devdoc>
        internal void SetOwner(Menu owner) {
            _owner = owner;

            if (_selectDesired == +1) {
                _selectDesired = 0;
                Selected = true;
            }
            else if (_selectDesired == -1) {
                _selectDesired = 0;
                Selected = false;
            }

            foreach (MenuItem item in ChildItems) {
                item.SetOwner(_owner);
            }
        }
Пример #55
0
		private static void CheckMenuItems (Menu m) {
			Assert.AreEqual (1, m.Items.Count, "CheckMenuItems#1");
			Assert.AreEqual (10, m.Items [0].ChildItems.Count, "CheckMenuItems#2");
			Assert.AreEqual (0, m.Items [0].ChildItems [0].ChildItems.Count, "CheckMenuItems#3");
			Assert.AreEqual (true, m.Items [0].ChildItems [0].DataBound, "CheckMenuItems#4");
			Assert.AreEqual ("/*[position()=1]/*[position()=1]", m.Items [0].ChildItems [0].DataPath, "CheckMenuItems#5");

			Assert.AreEqual (false, m.Items [0].Enabled, "CheckMenuItems_Enabled#1");
			Assert.AreEqual (true, m.Items [0].ChildItems [0].Enabled, "CheckMenuItems_Enabled#2");
			Assert.AreEqual (false, m.Items [0].ChildItems [1].Enabled, "CheckMenuItems_Enabled#3");
			Assert.AreEqual (false, m.Items [0].ChildItems [2].Enabled, "CheckMenuItems_Enabled#4");
			Assert.AreEqual (true, m.Items [0].ChildItems [2].ChildItems [0].Enabled, "CheckMenuItems_Enabled#5");

			Assert.AreEqual ("img#root", m.Items [0].ImageUrl, "CheckMenuItems_ImageUrl#1");
			Assert.AreEqual ("img#1", m.Items [0].ChildItems [0].ImageUrl, "CheckMenuItems_ImageUrl#2");
			Assert.AreEqual ("img#2", m.Items [0].ChildItems [1].ImageUrl, "CheckMenuItems_ImageUrl#3");
			Assert.AreEqual ("img#default", m.Items [0].ChildItems [2].ImageUrl, "CheckMenuItems_ImageUrl#4");
			Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].ImageUrl, "CheckMenuItems_ImageUrl#5");

			Assert.AreEqual ("url#root", m.Items [0].NavigateUrl, "CheckMenuItems_NavigateUrl#1");
			Assert.AreEqual ("url#1", m.Items [0].ChildItems [0].NavigateUrl, "CheckMenuItems_NavigateUrl#2");
			Assert.AreEqual ("url#2", m.Items [0].ChildItems [1].NavigateUrl, "CheckMenuItems_NavigateUrl#3");
			Assert.AreEqual ("url#default", m.Items [0].ChildItems [2].NavigateUrl, "CheckMenuItems_NavigateUrl#4");
			Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].NavigateUrl, "CheckMenuItems_NavigateUrl#5");

			Assert.AreEqual ("popoutimg#root", m.Items [0].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#1");
			Assert.AreEqual ("popoutimg#1", m.Items [0].ChildItems [0].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#2");
			Assert.AreEqual ("popoutimg#2", m.Items [0].ChildItems [1].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#3");
			Assert.AreEqual ("popoutimg#default", m.Items [0].ChildItems [2].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#4");
			Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#5");

			Assert.AreEqual (false, m.Items [0].Selectable, "CheckMenuItems_Selectable#1");
			Assert.AreEqual (true, m.Items [0].ChildItems [0].Selectable, "CheckMenuItems_Selectable#2");
			Assert.AreEqual (false, m.Items [0].ChildItems [1].Selectable, "CheckMenuItems_Selectable#3");
			Assert.AreEqual (false, m.Items [0].ChildItems [2].Selectable, "CheckMenuItems_Selectable#4");
			Assert.AreEqual (true, m.Items [0].ChildItems [2].ChildItems [0].Selectable, "CheckMenuItems_Selectable#5");

			Assert.AreEqual ("separatorimg#root", m.Items [0].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#1");
			Assert.AreEqual ("separatorimg#1", m.Items [0].ChildItems [0].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#2");
			Assert.AreEqual ("separatorimg#2", m.Items [0].ChildItems [1].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#3");
			Assert.AreEqual ("separatorimg#default", m.Items [0].ChildItems [2].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#4");
			Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#5");

			Assert.AreEqual ("target#root", m.Items [0].Target, "CheckMenuItems_Target#1");
			Assert.AreEqual ("target#1", m.Items [0].ChildItems [0].Target, "CheckMenuItems_Target#2");
			Assert.AreEqual ("target#2", m.Items [0].ChildItems [1].Target, "CheckMenuItems_Target#3");
			Assert.AreEqual ("target#default", m.Items [0].ChildItems [2].Target, "CheckMenuItems_Target#4");
			Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].Target, "CheckMenuItems_Target#5");

			Assert.AreEqual ("text#root", m.Items [0].Text, "CheckMenuItems_Text#1");
			Assert.AreEqual ("text#1", m.Items [0].ChildItems [0].Text, "CheckMenuItems_Text#2");
			Assert.AreEqual ("text#2", m.Items [0].ChildItems [1].Text, "CheckMenuItems_Text#3");
			Assert.AreEqual ("text#", m.Items [0].ChildItems [2].Text, "CheckMenuItems_Text#4");
			Assert.AreEqual ("subnode", m.Items [0].ChildItems [2].ChildItems [0].Text, "CheckMenuItems_Text#5");

			Assert.AreEqual ("tooltip#root", m.Items [0].ToolTip, "CheckMenuItems_ToolTip#1");
			Assert.AreEqual ("tooltip#1", m.Items [0].ChildItems [0].ToolTip, "CheckMenuItems_ToolTip#2");
			Assert.AreEqual ("tooltip#2", m.Items [0].ChildItems [1].ToolTip, "CheckMenuItems_ToolTip#3");
			Assert.AreEqual ("tooltip#default", m.Items [0].ChildItems [2].ToolTip, "CheckMenuItems_ToolTip#4");
			Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].ToolTip, "CheckMenuItems_ToolTip#5");

			Assert.AreEqual ("value#root", m.Items [0].Value, "CheckMenuItems_Value#1");
			Assert.AreEqual ("value#1", m.Items [0].ChildItems [0].Value, "CheckMenuItems_Value#2");
			Assert.AreEqual ("value#2", m.Items [0].ChildItems [1].Value, "CheckMenuItems_Value#3");
			Assert.AreEqual ("value#default", m.Items [0].ChildItems [2].Value, "CheckMenuItems_Value#4");
			Assert.AreEqual ("subnode", m.Items [0].ChildItems [2].ChildItems [0].Value, "CheckMenuItems_Value#5");

			Assert.AreEqual ("text#extra1", m.Items [0].ChildItems [3].Text, "CheckMenuItems_Extra1#1");
			Assert.AreEqual ("text#extra1", m.Items [0].ChildItems [3].Value, "CheckMenuItems_Extra1#2");

			Assert.AreEqual ("value#extra2", m.Items [0].ChildItems [4].Text, "CheckMenuItems_Extra2#1");
			Assert.AreEqual ("value#extra2", m.Items [0].ChildItems [4].Value, "CheckMenuItems_Extra2#2");

			Assert.AreEqual ("text#extra3", m.Items [0].ChildItems [5].Text, "CheckMenuItems_Extra3#1");
			Assert.AreEqual ("", m.Items [0].ChildItems [5].Value, "CheckMenuItems_Extra3#2");
			Assert.AreEqual ("", m.Items [0].ChildItems [6].Text, "CheckMenuItems_Extra3#3");
			Assert.AreEqual ("value#extra3", m.Items [0].ChildItems [6].Value, "CheckMenuItems_Extra3#4");
			Assert.AreEqual ("", m.Items [0].ChildItems [7].Text, "CheckMenuItems_Extra3#5");
			Assert.AreEqual ("", m.Items [0].ChildItems [7].Value, "CheckMenuItems_Extra3#6");

			Assert.AreEqual ("text#extra4", m.Items [0].ChildItems [8].Text, "CheckMenuItems_Extra4#1");
			Assert.AreEqual ("text#default", m.Items [0].ChildItems [8].Value, "CheckMenuItems_Extra4#2");

			Assert.AreEqual ("value#default", m.Items [0].ChildItems [9].Text, "CheckMenuItems_Extra5#1");
			Assert.AreEqual ("value#extra5", m.Items [0].ChildItems [9].Value, "CheckMenuItems_Extra5#2");
		}
Пример #56
0
 /// <devdoc>
 ///     Constructs a new MenuItem with the specified owner Menu
 /// </devdoc>
 internal MenuItem(Menu owner, bool isRoot)
     : this() {
     _owner = owner;
     _isRoot = isRoot;
 }
Пример #57
0
		public BaseMenuRenderer (Menu owner)
		{
			if (owner == null)
				throw new ArgumentNullException ("owner");

			this.Owner = owner;
		}
Пример #58
0
		public abstract bool IsDynamicItem (Menu owner, MenuItem item);
Пример #59
0
		internal MenuAdapter (Menu c) : base (c)
		{
		}
Пример #60
0
        private string GetItemClass(Menu menu, MenuItem item)
        {
            string value = "inactive";
            if ((item.Selected) || (IsChildItemSelected(item)))
            {
                value = "current";
            }

            if ((item != null) && (!item.Selectable)) { value += " unclickable"; }

            if ((useMenuTooltipForCustomCss) && (item.ToolTip.Length > 0))
            {
                value += " " + item.ToolTip; //we are using tooltip to store a custom css class
            }

            return value;
        }