private static ToolStripItem CreateMenuItem_AppLauncher_Virtual(string name, ToolStripItem[] items, bool fReorderEnabled, EventPack ep) { if (items.Length == 0) { return(null); } MenuItemArguments mia = new MenuItemArguments(name, MenuTarget.VirtualFolder, MenuGenre.Application) { App = new UserApp(name) }; DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null) { ReorderEnabled = fReorderEnabled, MessageParent = ep.MessageParentHandle, ImageList = QTUtility.ImageListGlobal }; reorderable.AddItemsRange(items, "userappItem"); reorderable.ItemRightClicked += ep.ItemRightClickEventHandler; reorderable.ItemClicked += virtualDirectory_DropDownItemClicked; reorderable.ReorderFinished += virtualDirectory_ReorderFinished; return(new QMenuItem(name, mia) { ImageKey = "folder", Name = name, DropDown = reorderable }); }
private static ToolStripItem CreateMenuItem_AppLauncher_Virtual(string key, bool fReorderEnabled, RegistryKey rkSub, EventPack ep) { string[] valueNames = rkSub.GetValueNames(); if ((valueNames != null) && (valueNames.Length > 0)) { List <ToolStripItem> list = new List <ToolStripItem>(); foreach (string str in valueNames) { string[] appVals = QTUtility2.ReadRegBinary <string>(str, rkSub); if (appVals != null) { if ((appVals.Length == 3) || (appVals.Length == 4)) { list.Add(CreateMenuItem_AppLauncher(str, appVals, ep)); } } else { using (RegistryKey key2 = rkSub.OpenSubKey(str, false)) { if (key2 != null) { ToolStripItem item = CreateMenuItem_AppLauncher_Virtual(str, fReorderEnabled, key2, ep); if (item != null) { list.Add(item); } } } } } if (list.Count > 0) { QMenuItem item2 = new QMenuItem(key, new MenuItemArguments(key, MenuTarget.VirtualFolder, MenuGenre.Application)); item2.ImageKey = "folder"; item2.Name = key; DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null); reorderable.ReorderEnabled = fReorderEnabled; reorderable.MessageParent = ep.MessageParentHandle; reorderable.ItemRightClicked += ep.ItemRightClickEventHandler; reorderable.ImageList = QTUtility.ImageListGlobal; reorderable.AddItemsRange(list.ToArray(), "userappItem"); reorderable.ItemClicked += new ToolStripItemClickedEventHandler(MenuUtility.virtualDirectory_DropDownItemClicked); reorderable.ReorderFinished += new MenuReorderedEventHandler(MenuUtility.virtualDirectory_ReorderFinished); string name = rkSub.Name; reorderable.Name = name.Substring(name.IndexOf(@"Software\Quizo\QTTabBar\UserApps\")); item2.DropDown = reorderable; return(item2); } } return(null); }
private static ToolStripItem CreateMenuItem_AppLauncher_Virtual(string key, bool fReorderEnabled, RegistryKey rkSub, EventPack ep) { string[] valueNames = rkSub.GetValueNames(); if((valueNames != null) && (valueNames.Length > 0)) { List<ToolStripItem> list = new List<ToolStripItem>(); foreach(string str in valueNames) { string[] appVals = QTUtility2.ReadRegBinary<string>(str, rkSub); if(appVals != null) { if((appVals.Length == 3) || (appVals.Length == 4)) { list.Add(CreateMenuItem_AppLauncher(str, appVals, ep)); } } else { using(RegistryKey key2 = rkSub.OpenSubKey(str, false)) { if(key2 != null) { ToolStripItem item = CreateMenuItem_AppLauncher_Virtual(str, fReorderEnabled, key2, ep); if(item != null) { list.Add(item); } } } } } if(list.Count > 0) { QMenuItem item2 = new QMenuItem(key, new MenuItemArguments(key, MenuTarget.VirtualFolder, MenuGenre.Application)); item2.ImageKey = "folder"; item2.Name = key; DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null); reorderable.ReorderEnabled = fReorderEnabled; reorderable.MessageParent = ep.MessageParentHandle; reorderable.ItemRightClicked += ep.ItemRightClickEventHandler; reorderable.ImageList = QTUtility.ImageListGlobal; reorderable.AddItemsRange(list.ToArray(), "userappItem"); reorderable.ItemClicked += virtualDirectory_DropDownItemClicked; reorderable.ReorderFinished += virtualDirectory_ReorderFinished; string name = rkSub.Name; reorderable.Name = name.Substring(name.IndexOf(@"Software\Quizo\QTTabBar\UserApps\")); item2.DropDown = reorderable; return item2; } } return null; }
private static ToolStripItem CreateMenuItem_AppLauncher_Virtual(string name, ToolStripItem[] items, bool fReorderEnabled, EventPack ep) { if(items.Length == 0) return null; MenuItemArguments mia = new MenuItemArguments(name, MenuTarget.VirtualFolder, MenuGenre.Application) { App = new UserApp(name) }; DropDownMenuReorderable reorderable = new DropDownMenuReorderable(null) { ReorderEnabled = fReorderEnabled, MessageParent = ep.MessageParentHandle, ImageList = QTUtility.ImageListGlobal }; reorderable.AddItemsRange(items, "userappItem"); reorderable.ItemRightClicked += ep.ItemRightClickEventHandler; reorderable.ItemClicked += virtualDirectory_DropDownItemClicked; reorderable.ReorderFinished += virtualDirectory_ReorderFinished; return new QMenuItem(name, mia) { ImageKey = "folder", Name = name, DropDown = reorderable }; }