public void RemoveAppConfirm(ApplicationInfo app, CairoMessage.DialogResultDelegate resultCallback)
        {
            if (app == null)
            {
                return;
            }

            string menu;

            if (app.Category.Type == AppCategoryType.QuickLaunch)
            {
                menu = DisplayString.sAppGrabber_QuickLaunch;
            }
            else
            {
                menu = DisplayString.sProgramsMenu;
            }

            CairoMessage.ShowOkCancel(string.Format(DisplayString.sProgramsMenu_RemoveInfo, app.Name, menu),
                                      DisplayString.sProgramsMenu_RemoveTitle, CairoMessageImage.Warning,
                                      DisplayString.sProgramsMenu_Remove, DisplayString.sInterface_Cancel,
                                      result =>
            {
                if (result == true)
                {
                    app.Category.Remove(app);
                    Save();
                }

                resultCallback?.Invoke(result);
            });
        }
示例#2
0
        public void RemoveAppConfirm(ApplicationInfo app)
        {
            if (app != null)
            {
                string menu;
                if (app.Category.Type == AppCategoryType.QuickLaunch)
                {
                    menu = Localization.DisplayString.sAppGrabber_QuickLaunch;
                }
                else
                {
                    menu = Localization.DisplayString.sProgramsMenu;
                }

                CairoMessage.ShowOkCancel(string.Format(Localization.DisplayString.sProgramsMenu_RemoveInfo, app.Name, menu),
                                          Localization.DisplayString.sProgramsMenu_RemoveTitle, CairoMessageImage.Warning,
                                          Localization.DisplayString.sProgramsMenu_Remove, Localization.DisplayString.sInterface_Cancel,
                                          result =>
                {
                    if (result == true)
                    {
                        app.Category.Remove(app);
                        Save();
                    }
                });
            }
        }
示例#3
0
        public static void PerformAction(string verb, string fileName)
        {
            switch (verb)
            {
            case Actions.Open:
                ShellHelper.StartProcess(fileName);
                return;

            case Actions.Delete:
                string displayName = ShellHelper.GetDisplayName(fileName);
                CairoMessage.ShowOkCancel(string.Format(Localization.DisplayString.sDesktop_DeleteInfo, displayName),
                                          Localization.DisplayString.sDesktop_DeleteTitle, CairoMessageImage.Warning,
                                          Localization.DisplayString.sInterface_Delete, Localization.DisplayString.sInterface_Cancel,
                                          result =>
                {
                    if (result == true)
                    {
                        ShellHelper.SendToRecycleBin(fileName);
                    }
                });
                return;

            case Actions.Properties:
                ShellHelper.ShowFileProperties(fileName);
                return;

            case Actions.Copy:
                StringCollection scPath = new StringCollection();
                scPath.Add(fileName);
                System.Windows.Forms.Clipboard.SetFileDropList(scPath);
                return;

            case Actions.AddStack:
                StacksManager.Instance.AddLocation(fileName);
                return;

            case Actions.RemoveStack:
                StacksManager.Instance.RemoveLocation(fileName);
                return;

            case Actions.OpenWithShell:
                FolderHelper.OpenWithShell(fileName);
                break;

            case Actions.Personalize:
                ShellHelper.StartProcess("Rundll32.exe", "shell32.dll,Control_RunDLL desk.cpl,,2");
                break;

            case Actions.DisplaySettings:
                ShellHelper.StartProcess("Rundll32.exe", "shell32.dll,Control_RunDLL desk.cpl,,3");
                break;

            default:
                ShellHelper.StartProcess(fileName, "", verb);
                break;
            }
        }
示例#4
0
        public void RemoveAppConfirm(ApplicationInfo app)
        {
            string menu;

            if (app.Category.Type == AppCategoryType.QuickLaunch)
            {
                menu = Localization.DisplayString.sAppGrabber_QuickLaunch;
            }
            else
            {
                menu = Localization.DisplayString.sProgramsMenu;
            }
            bool?deleteChoice = CairoMessage.ShowOkCancel(String.Format(Localization.DisplayString.sProgramsMenu_RemoveInfo, app.Name, menu), Localization.DisplayString.sProgramsMenu_RemoveTitle, "Resources/cairoIcon.png", Localization.DisplayString.sProgramsMenu_Remove, Localization.DisplayString.sInterface_Cancel);

            if (deleteChoice.HasValue && deleteChoice.Value)
            {
                app.Category.Remove(app);
                Save();
            }
        }
        public static void PerformAction(string verb, string fileName)
        {
            var desktopManager    = CairoApplication.Current.Host.Services.GetService <DesktopManager>();
            var settingsUiService = CairoApplication.Current.Host.Services.GetService <ISettingsUIService>();

            switch (verb)
            {
            case Actions.Open:
                desktopManager.IsOverlayOpen = false;
                ShellHelper.StartProcess(fileName);
                return;

            case Actions.OpenWith:
                desktopManager.IsOverlayOpen = false;
                ShellHelper.ShowOpenWithDialog(fileName);
                return;

            case Actions.Delete:
                string displayName = ShellHelper.GetDisplayName(fileName);
                CairoMessage.ShowOkCancel(string.Format(Localization.DisplayString.sDesktop_DeleteInfo, displayName),
                                          Localization.DisplayString.sDesktop_DeleteTitle, CairoMessageImage.Warning,
                                          Localization.DisplayString.sInterface_Delete, Localization.DisplayString.sInterface_Cancel,
                                          result =>
                {
                    if (result == true)
                    {
                        ShellHelper.SendToRecycleBin(fileName);
                    }
                });
                return;

            case Actions.Properties:
                ShellHelper.ShowFileProperties(fileName);
                desktopManager.IsOverlayOpen = false;
                return;

            case Actions.Copy:
                StringCollection scPath = new StringCollection();
                scPath.Add(fileName);
                System.Windows.Forms.Clipboard.SetFileDropList(scPath);
                return;

            case DirectoryActions.AddStack:
                StacksManager.Instance.AddLocation(fileName);
                return;

            case DirectoryActions.RemoveStack:
                StacksManager.Instance.StackLocations.Remove(new SystemDirectory(fileName, _dispatcher));
                return;

            case Actions.OpenWithShell:
                FolderHelper.OpenWithShell(fileName);
                break;

            case Actions.Personalize when EnvironmentHelper.IsAppRunningAsShell:
                settingsUiService?.Show("desktop");
                break;

            case Actions.Personalize:
                ShellHelper.StartProcess("Rundll32.exe", "shell32.dll,Control_RunDLL desk.cpl,,2");
                break;

            case Actions.DisplaySettings:
                ShellHelper.StartProcess("Rundll32.exe", "shell32.dll,Control_RunDLL desk.cpl,,3");
                break;

            default:
                ShellHelper.StartProcess(fileName, "", verb);
                break;
            }
        }