public override void InitializeConfig() { tvwApps.ItemsSource = CurrentApps = new ParentedCollection <AppEntry>(null, AppsManager.BuildNestedStructure( app => new AppEntry(app), (folderName, children) => new AppEntry(folderName, children))); }
public override void CommitConfig() { AppsManager.SetUserAppsFromNestedStructure( CurrentApps, entry => entry.IsFolder ? new UserApp(entry.Name) : new UserApp(entry.Name, entry.Path, entry.Args, entry.WorkingDir, entry.ShortcutKey), entry => entry.Children); }
public static List <ToolStripItem> CreateAppLauncherItems(IntPtr hwndParent, ShellBrowserEx shellBrowser, bool fReorderEnabled, ItemRightClickedEventHandler rightClickHandler, EventHandler dirDoubleClickEvent, bool fFromTaskBar) { // todo: refresh? EventPack ep = new EventPack(hwndParent, rightClickHandler, dirDoubleClickEvent, fFromTaskBar); return(AppsManager.BuildNestedStructure( userApp => CreateMenuItem_AppLauncher(userApp, ep, shellBrowser), (folderName, children) => CreateMenuItem_AppLauncher_Virtual( folderName, children, fReorderEnabled, ep)).ToList()); }
private static void virtualDirectory_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { QMenuItem clickedItem = e.ClickedItem as QMenuItem; if (clickedItem == null || clickedItem.Target != MenuTarget.File) { return; } MenuItemArguments mia = clickedItem.MenuItemArguments; AppsManager.Execute(mia.App, mia.ShellBrowser); }
private static void virtualDirectory_ReorderFinished(object sender, ToolStripItemClickedEventArgs e) { AppsManager.HandleReorder(((DropDownMenuReorderable)sender).Items.Cast <ToolStripItem>()); }