Exemplo n.º 1
0
 void createButton(FlexModel.MenuItem el)
 {
     foreach (var item in _menus.Where(m => m.ParentID == el.ID))
     {
         if (!_security.Any(s => s.MenuItem_ID == item.ID))
         {
             var button = ribbon1.Items.CreateButton(item.Caption);
             itemClickAssign(button, item.FormName);
             popup.ItemLinks.Add(button);
         }
     }
 }
Exemplo n.º 2
0
 void createRibPage(FlexModel.MenuItem el)
 {
     page1 = new DevExpress.XtraBars.Ribbon.RibbonPage(el.Caption);
     ribbon1.Pages.Add(page1);
     foreach (var item in _menus.Where(m => m.ParentID == el.ID))
     {
         if (!_security.Any(s => s.MenuItem_ID == item.ID))
         {
             createRibPageGroup(item);
         }
     }
 }
Exemplo n.º 3
0
 void createRibPageGroup(FlexModel.MenuItem el)
 {
     group1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup(el.Caption);
     group1.ShowCaptionButton = false;
     foreach (var item in _menus.Where(m => m.ParentID == el.ID))
     {
         if (!_security.Any(s => s.MenuItem_ID == item.ID))
         {
             createDropDownButton(item);
         }
     }
     page1.Groups.Add(group1);
 }
Exemplo n.º 4
0
        void createDropDownButton(FlexModel.MenuItem el)
        {
            popup = new DevExpress.XtraBars.PopupMenu();
            var menu = ribbon1.Items.CreateButton(el.Caption);

            menu.ActAsDropDown    = true;
            menu.ButtonStyle      = DevExpress.XtraBars.BarButtonStyle.DropDown;
            menu.CausesValidation = true;
            foreach (var item in _menus.Where(m => m.ParentID == el.ID))
            {
                if (!_security.Any(s => s.MenuItem_ID == item.ID))
                {
                    createButton(item);
                }
            }
            menu.DropDownControl = popup;
            group1.ItemLinks.Add(menu);
        }