예제 #1
0
        private static void CreateListMenuWithItem(string RootPath, bool MutipleSelection = true)
        {
            MenuFilter OutMenu;

            GetMenuItemsFromRoot(RootPath, out OutMenu);
            if (OutMenu == null)
            {
                return;
            }

            ItemSelectorMenu = new ItemSelector(OutMenu, MutipleSelection);
        }
예제 #2
0
        public static List <string> ShowContextMenuWithItem(string RootPath, string MenuText = null, bool MutipleSelection = true)
        {
            ItemSelectorMenu = null;

            CreateListMenuWithItem(RootPath, MutipleSelection);
            if (ItemSelectorMenu == null)
            {
                ItemSelectorMenu = new ItemSelector();
            }

            if (MenuText != null)
            {
                ItemSelectorMenu.Text = MenuText;
            }
            ItemSelectorMenu.TopMost = true;
            ItemSelectorMenu.ShowDialog();
            //Item selected, call the ItemsSelected method.
            if (ItemSelectorMenu.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                return(ItemSelectorMenu.GetResult());
            }
            return(null);
        }