void AddRenameCommand(IClass c, List <ToolStripItem> resultItems)
        {
            var cmd = new MenuCommand("${res:SharpDevelop.Refactoring.RenameCommand}", Rename);

            cmd.ShortcutKeys = MenuCommand.ParseShortcut("Control|R");
            cmd.Tag          = c;
            resultItems.Add(cmd);
        }
Ejemplo n.º 2
0
            public MyMenuItem(PadDescriptor padDescriptor) : base(null, null)
            {
                this.padDescriptor = padDescriptor;
                Text = StringParser.Parse(padDescriptor.Title);

                if (!string.IsNullOrEmpty(padDescriptor.Icon))
                {
                    base.Image = IconService.GetBitmap(padDescriptor.Icon);
                }

                if (padDescriptor.Shortcut != null)
                {
                    ShortcutKeys = MenuCommand.ParseShortcut(padDescriptor.Shortcut);
                }
            }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the keyboard shortcut for the menu item with the given addin tree
        /// path and given codon id.
        /// </summary>
        Keys GetKeyboardShortcut(string path, string id)
        {
            AddInTreeNode node = AddInTree.GetTreeNode(path);

            if (node != null)
            {
                foreach (Codon codon in node.Codons)
                {
                    if (codon.Id == id)
                    {
                        return(MenuCommand.ParseShortcut(codon.Properties["shortcut"]));
                    }
                }
            }
            return(Keys.None);
        }