/// <override></override> public override void Execute(MenuItemDef action, Project project) { if (action == null) { throw new ArgumentNullException("action"); } if (project == null) { throw new ArgumentNullException("project"); } // nothing to do }
/// <override></override> public override void Execute(MenuItemDef action, Project project) { if (action == null) { throw new ArgumentNullException("action"); } if (project == null) { throw new ArgumentNullException("project"); } executeDelegate(action, project); }
/// <override></override> public override void Execute(MenuItemDef action, Project project) { if (action == null) { throw new ArgumentNullException("action"); } if (project == null) { throw new ArgumentNullException("project"); } throw new NotImplementedException(); }
/// <override></override> public override void Execute(MenuItemDef action, Project project) { if (action == null) { throw new ArgumentNullException("action"); } if (project == null) { throw new ArgumentNullException("project"); } if (command != null) { project.ExecuteCommand(command); } }
private static ToolStripItem CreateMenuItemFromAction(MenuItemDef action, Project project) { if (action is SeparatorMenuItemDef) return CreateMenuItemSeparator(); else { // Build ContextMenu item ToolStripMenuItem menuItem = new ToolStripMenuItem(action.Title, null, (s, e) => action.Execute(action, project)); menuItem.Tag = action; menuItem.Name = action.Name; menuItem.Text = action.Title; menuItem.Checked = action.Checked; //menuItem.CheckOnClick = false; menuItem.Enabled = (action.IsFeasible && action.IsGranted(project.SecurityManager)); if (action.IsFeasible && !action.IsGranted(project.SecurityManager)) { if (action is DelegateMenuItemDef) menuItem.ToolTipText = string.Format("Action is deactivated because you don't have the permission for '{0}'.", ((DelegateMenuItemDef)action).RequiredPermission); else menuItem.ToolTipText = "Action is deactivated because you don't have the required permissions."; } else menuItem.ToolTipText = action.Description; menuItem.Image = action.Image; menuItem.ImageTransparentColor = action.ImageTransparentColor; menuItem.DropDownItems.Clear(); // Add sub menu items (do not skip any sub items: if parent is granted, subitems are granted too) if (action.SubItems != null) { for (int i = 0; i < action.SubItems.Length; ++i) menuItem.DropDownItems.Add(CreateMenuItemFromAction(action.SubItems[i], project)); } return menuItem; } }
/// <override></override> public override void Execute(MenuItemDef action, Project project) { //if (action == null) throw new ArgumentNullException("action"); //if (project == null) throw new ArgumentNullException("project"); //if (DefaultAction != null) DefaultAction.Execute(DefaultAction, project); }
/// <override></override> public override void Execute(MenuItemDef action, Project project) { if (action == null) throw new ArgumentNullException("action"); if (project == null) throw new ArgumentNullException("project"); if (command != null) project.ExecuteCommand(command); }
/// <ToBeCompleted></ToBeCompleted> public abstract void Execute(MenuItemDef action, Project project);
/// <override></override> public override void Execute(MenuItemDef action, Project project) { if (action == null) throw new ArgumentNullException("action"); if (project == null) throw new ArgumentNullException("project"); throw new NotImplementedException(); }
/// <override></override> public override void Execute(MenuItemDef action, Project project) { if (action == null) throw new ArgumentNullException("action"); if (project == null) throw new ArgumentNullException("project"); // nothing to do }
/// <ToBeCompleted></ToBeCompleted> public GroupMenuItemDef(string title, Bitmap image, Color transparentColor, string name, string description, bool isChecked, bool isFeasible, MenuItemDef[] actions, int defaultActionIndex) : base(title, image, transparentColor, name, description, isChecked, isFeasible) { this.subItems = actions; this.defaultActionIdx = defaultActionIndex; }
/// <ToBeCompleted></ToBeCompleted> public GroupMenuItemDef(string title, Bitmap image, string description, bool isFeasible, MenuItemDef[] actions, int defaultActionIndex) : base(title, image, description, isFeasible) { this.subItems = actions; this.defaultActionIdx = defaultActionIndex; }
/// <override></override> public override void Execute(MenuItemDef action, Project project) { if (action == null) throw new ArgumentNullException("action"); if (project == null) throw new ArgumentNullException("project"); executeDelegate(action, project); }