Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        public virtual bool IsActionVisible(ActionMetaItem action)
        {
            if (BaseGridPanel != null && action.PanelType == ActionsPanelType.Top)
            {
                switch (BaseGridPanel.SelectMode)
                {
                case SelectMode.MultiSelect:
                    return(action.ActionType == ActionTypes.SelectAll || action.ActionType == ActionTypes.Select);

                case SelectMode.SimpleSelect:
                    return(action.ActionType == ActionTypes.Select);

                default:
                    if (action.ActionType == ActionTypes.SelectAll || action.ActionType == ActionTypes.Select)
                    {
                        return(false);
                    }

                    return(action.IsVisible(BusinessObject, Permissions));
                }
            }
            return(action.IsVisible(BusinessObject, Permissions));
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        public override bool IsActionVisible(ActionMetaItem action)
        {
            if (!action.IsVisible(BusinessObject, Permissions))
            {
                return(false);
            }
            switch (action.ActionType)
            {
            case ActionTypes.Create:
                return(!(BaseGridPanel != null && BaseGridPanel.InlineMode == InlineMode.UseNewRow));

            case ActionTypes.Edit:
                return(BaseGridPanel != null && BaseGridPanel.InlineMode == InlineMode.None);

            default:
                return(base.IsActionVisible(action));
            }
        }