示例#1
0
 public override void InitializeConfig()
 {
     tvwApps.ItemsSource = CurrentApps = new ParentedCollection <AppEntry>(null,
                                                                           AppsManager.BuildNestedStructure(
                                                                               app => new AppEntry(app),
                                                                               (folderName, children) => new AppEntry(folderName, children)));
 }
示例#2
0
 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);
 }
示例#3
0
        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());
        }
示例#4
0
        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);
        }
示例#5
0
 private static void virtualDirectory_ReorderFinished(object sender, ToolStripItemClickedEventArgs e)
 {
     AppsManager.HandleReorder(((DropDownMenuReorderable)sender).Items.Cast <ToolStripItem>());
 }