/// <summary> /// /// </summary> /// <param name="control"></param> /// <param name="panelType"></param> public override void AddCustomControlToActionPanel(Control control, ActionsPanelType panelType) { if (panelType == ActionsPanelType.Group) { TopGroupActionPanel.AddCustomControl(control); } }
/// <summary> /// Визуализация действий на панели /// </summary> /// <param name="actions"></param> /// <param name="panelType"></param> public void AddActionsRoutines(List <ActionMetaItem> actions, ActionsPanelType panelType) { m_AllActions = actions; var avaliableActions = actions.Where(c => c.PanelType.Equals(panelType)).ToList(); ////var permissions = BusinessObject != null ? BusinessObject.GetAccessor() as IObjectPermissions : null; foreach (var action in avaliableActions) { //проверим, есть ли у текущего пользователя права на это действие //если нет, то не рендерим это действие //perm!!var showAction = action.CheckPermission(permissions, BusinessObject != null && BusinessObject.ReadOnly); //perm!! ParentLayout.ParentBasePanel.CheckActionPermission(action, ref showAction); //perm!!if (!showAction) continue; /*perm!! * if (permissions != null) * { * switch(action.ActionType) * { * case ActionTypes.Edit: * action.ReadOnly = !permissions.CanUpdate || ParentLayout.ParentBasePanel.ReadOnly; * break; * case ActionTypes.View: * action.ReadOnly = permissions.CanUpdate; * break; * case ActionTypes.Delete: * action.ReadOnly = !permissions.CanDelete; * break; * case ActionTypes.Create: * action.ReadOnly = !permissions.CanInsert; * break; * } * }*/ if (action.IsVisible(BusinessObject, Permissions) && (action.AppType == ActionsAppType.All || action.AppType == ActionsAppType.Win)) { AddAction(action); } } RecalculateActionsPositions(); if (BaseGridPanel != null) { BaseGridPanel.RefreshFocusedItem(); } }
public VisualItem ( string caption, string icon, string tooltip, string captionReadonly, string iconReadonly, string tooltipReadonly, ActionsAlignment align, ActionsPanelType panel, ActionsAppType app ) { CaptionId = caption; IconId = icon; TooltipId = tooltip; CaptionIdReadOnly = captionReadonly; IconIdReadOnly = iconReadonly; TooltipIdReadOnly = tooltipReadonly; Alignment = align; PanelType = panel; AppType = app; }
/// <summary> /// Добавление произвольного контрола на указанную панель /// </summary> /// <param name="control"></param> /// <param name="panelType"></param> public virtual void AddCustomControlToActionPanel(Control control, ActionsPanelType panelType) { }