public DatabaseHierarchyNode(string kod, string nazov, RenderDatabaseNodeDelegate renderMethod, Filter additionalFilter = null, string typ = HierarchyNodeType.Unknown, string icon = HierarchyNodeIconCls.Unknown, PfeSelection selectionMode = PfeSelection.Single)
 {
     this.Kod              = kod;
     this.Nazov            = nazov;
     this.Typ              = typ;
     this.IconCls          = icon;
     this.ModelType        = typeof(T);
     this.AdditionalFilter = additionalFilter;
     this.SelectionMode    = selectionMode;
     this.renderMethod     = renderMethod;
 }
示例#2
0
        /// <summary>
        /// Generuje akcie v submenu do MenuButtonsAll
        /// </summary>
        /// <returns></returns>
        public static List <NodeAction> AddMenuButtonsAll(this List <NodeAction> list, NodeActionType type, Type actionType,
                                                          string folderCaption = "Add", string buttonCaption = "", PfeSelection pfeSelection = PfeSelection.Single, NodeActionIcons actionIcon = NodeActionIcons.Default, string url = null)
        {
            var nodeAction = new NodeAction(type, actionType, buttonCaption)
            {
                SelectionMode = pfeSelection
            };

            if (!string.IsNullOrEmpty(url))
            {
                nodeAction.Url = url;
            }

            if (list.Where(f => f.ActionIcon == NodeActionIcons.Plus).Count() == 0)
            {
                NodeAction na;
                na = new NodeAction(NodeActionType.MenuButtonsAll)
                {
                    ActionIcon  = (folderCaption == "Add") ? NodeActionIcons.Plus : actionIcon,
                    Caption     = (folderCaption == "Add") ? "" : folderCaption, //Už nedávam na podgridy popis "Pridať". stačí ikonka
                    MenuButtons = new List <NodeAction>()
                    {
                        nodeAction
                    }
                };
                list.Insert(0, na);
            }
            else
            {
                list.Where(f => f.ActionIcon == NodeActionIcons.Plus).First().MenuButtons.Add(nodeAction);
            };

            return(list);
        }