Ejemplo n.º 1
0
        public virtual IMenuEntry GetContextMenu(object element)
        {
            var menu    = new MenuEntry();
            var newMenu = new MenuEntry("New");
            var docMenu = new MenuEntry("Document");

            docMenu.UserData           = element;
            docMenu.OnMenuItemClicked += MenuItemClickedCB;
            menu.Add(newMenu);
            newMenu.Add(docMenu);
            return(menu);
        }
Ejemplo n.º 2
0
        public IMenuEntry GetContextMenu(object element)
        {
            if (element is ProjectContainer)
            {
                var menu             = new MenuEntry();
                var addReferenceItem = new MenuEntry("Add Reference to Assembly");
                addReferenceItem.UserData           = (element as ProjectContainer).Project;
                addReferenceItem.OnMenuItemClicked += new EventHandler(AddReferenceItemClickedCB);

                var addProjectItem = new MenuEntry("Add Reference to Project");
                addProjectItem.UserData           = (element as ProjectContainer).Project;
                addProjectItem.OnMenuItemClicked += new EventHandler(AddProjectItemClickedCB);

                menu.Add(addReferenceItem);
                menu.Add(addProjectItem);
                return(menu);
            }
            else
            {
                return(new MenuEntry());
            }
        }