Пример #1
0
 /// <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
 }
Пример #2
0
 /// <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);
 }
Пример #3
0
 /// <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();
 }
Пример #4
0
 /// <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);
     }
 }
Пример #5
0
        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;
            }
        }
Пример #6
0
 /// <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);
 }
Пример #7
0
 /// <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);
 }
Пример #8
0
 /// <ToBeCompleted></ToBeCompleted>
 public abstract void Execute(MenuItemDef action, Project project);
Пример #9
0
 /// <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();
 }
Пример #10
0
 /// <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
 }
Пример #11
0
 /// <ToBeCompleted></ToBeCompleted>
 public abstract void Execute(MenuItemDef action, Project project);
Пример #12
0
 /// <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);
 }
Пример #13
0
 /// <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;
 }
Пример #14
0
 /// <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;
 }
Пример #15
0
 /// <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);
 }