Example #1
0
        public void SetPermisonInBarItemLink(string menuname, BarItemLink page, ref bool visibleGroup)
        {
            BarItem barItem = page.Item;

            if (barItem != null)
            {
                if (barItem.Name == menuname)
                {
                    barItem.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                    visibleGroup       = true;
                }
                if (barItem.GetType().FullName == "DevExpress.XtraBars.BarSubItem")
                {
                    BarSubItem mBarSubItem = (BarSubItem)barItem;
                    foreach (BarItemLink menuSubLink in mBarSubItem.ItemLinks)
                    {
                        SetPermisonInBarItemLink(menuname, menuSubLink, ref visibleGroup);
                        if (visibleGroup)
                        {
                            barItem.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                            break;
                        }
                    }
                }
            }
        }
Example #2
0
 public DefaultAction(BarItem barItem)
 {
     this.type       = barItem.GetType();
     this.content    = barItem.Content;
     this.glyph      = barItem.Glyph;
     this.largeGlyph = barItem.LargeGlyph;
 }
        private Item GetItem(BarItem obj, Item ItemCha, bool isNullCreateNew)
        {
            var item = obj.Tag as Item;

            if (item == null && isNullCreateNew == true)
            {
                Guid?ItemChaId = null;
                if (ItemCha != null)
                {
                    ItemChaId = ItemCha.ItemId;
                }
                item = new Item {
                    ItemChaId = ItemChaId, Text = obj.Caption, ObjectTypeName = obj.GetType().FullName, ImageWin = obj.Glyph, LargeImageWin = obj.LargeGlyph
                };
                obj.Tag = item;
            }
            return(item);
        }
Example #4
0
        public void GetPermisonInBarItemLink(TreeNode Node, BarItemLink page)
        {
            TreeNode anode1  = new TreeNode();
            BarItem  barItem = page.Item;

            if (barItem != null)
            {
                anode1      = new TreeNode(barItem.Caption);
                anode1.Name = barItem.Name;
                Node.Nodes.Add(anode1);

                if (barItem.GetType().FullName == "DevExpress.XtraBars.BarSubItem")
                {
                    BarSubItem mBarSubItem = (BarSubItem)barItem;
                    foreach (BarItemLink mSubLink in mBarSubItem.ItemLinks)
                    {
                        GetPermisonInBarItemLink(anode1, mSubLink);
                    }
                }
            }
        }