Example #1
0
        private void HandleFolderAction(uint action, string path)
        {
            // TODO: Use command system
            switch (action)
            {
            case (uint)CommonContextMenuItem.Paste:
                _fileWorker.PasteFromClipboard(path);
                break;

            case (uint)CommonContextMenuItem.Properties:
                _desktopManager.IsOverlayOpen = false;
                CustomCommands.PerformAction(CustomCommands.Actions.Properties, path);
                break;

            case (uint)CairoContextMenuItem.OpenInNewWindow:
                _desktopManager.IsOverlayOpen = false;
                CustomCommands.PerformAction(CustomCommands.Actions.OpenWithShell, path);
                break;

            case (uint)CairoContextMenuItem.DisplaySettings:
                _desktopManager.IsOverlayOpen = false;
                CustomCommands.PerformAction(CustomCommands.Actions.DisplaySettings, path);
                break;

            case (uint)CairoContextMenuItem.Personalize when EnvironmentHelper.IsAppRunningAsShell:
                _desktopManager.IsOverlayOpen = false;
                _settingsUiService?.Show("desktop");
                break;

            case (uint)CairoContextMenuItem.Personalize:
                _desktopManager.IsOverlayOpen = false;
                CustomCommands.PerformAction(CustomCommands.Actions.Personalize, path);
                break;

            case (uint)CairoContextMenuItem.AddToStacks:
                CustomCommands.PerformAction(CustomCommands.Actions.AddStack, path);
                break;

            case (uint)CairoContextMenuItem.RemoveFromStacks:
                CustomCommands.PerformAction(CustomCommands.Actions.RemoveStack, path);
                break;

            default:
                // must be "New" menu
                CairoApplication.Current.Dispatcher.Invoke(() =>
                {
                    if (_desktopManager.IsOverlayOpen)
                    {
                        _desktopManager.DesktopOverlayWindow.Activate();
                    }
                    else
                    {
                        Activate();
                    }
                });
                // watch for new file to be created so we can perform an action
                _desktopManager.DesktopLocation.Files.CollectionChanged += ShellNew_FileCreated;
                break;
            }
        }
Example #2
0
 private void InitCairoSettingsWindow(object sender, RoutedEventArgs e)
 {
     _settingsUiService.Show();
 }