Esempio n. 1
0
        private void AddActionToList(HotkeyType hotkeyType)
        {
            ListViewItem lvi = new ListViewItem()
            {
                Text     = hotkeyType.GetLocalizedDescription(),
                ImageKey = hotkeyType.ToString()
            };

            lvActions.Items.Add(lvi);
        }
Esempio n. 2
0
        private void AddActionToList(HotkeyType hotkeyType)
        {
            string text;

            if (hotkeyType == HotkeyType.None)
            {
                text = Resources.ActionsToolbarEditForm_Separator;
            }
            else
            {
                text = hotkeyType.GetLocalizedDescription();
            }

            ListViewItem lvi = new ListViewItem()
            {
                Text     = text,
                ImageKey = hotkeyType.ToString()
            };

            lvActions.Items.Add(lvi);
        }
Esempio n. 3
0
 public override string ToString()
 {
     return(!string.IsNullOrEmpty(Description) ? Description : Job.GetLocalizedDescription());
 }
Esempio n. 4
0
        public static void ExecuteJob(TaskSettings taskSettings, HotkeyType job, CLICommand command = null)
        {
            if (job == HotkeyType.None)
            {
                return;
            }

            DebugHelper.WriteLine("Executing: " + job.GetLocalizedDescription());

            TaskSettings safeTaskSettings = TaskSettings.GetSafeTaskSettings(taskSettings);

            switch (job)
            {
            // Screen capture
            case HotkeyType.PrintScreen:
                CaptureTaskHelpers.CaptureScreenshot(CaptureType.Fullscreen, safeTaskSettings, false);
                break;

            case HotkeyType.ActiveWindow:
                CaptureTaskHelpers.CaptureScreenshot(CaptureType.ActiveWindow, safeTaskSettings, false);
                break;

            case HotkeyType.ActiveMonitor:
                CaptureTaskHelpers.CaptureScreenshot(CaptureType.ActiveMonitor, safeTaskSettings, false);
                break;

            case HotkeyType.RectangleRegion:
                CaptureTaskHelpers.CaptureScreenshot(CaptureType.Region, safeTaskSettings, false);
                break;

            case HotkeyType.RectangleLight:
                CaptureTaskHelpers.CaptureRectangleLight(safeTaskSettings, false);
                break;

            case HotkeyType.RectangleTransparent:
                CaptureTaskHelpers.CaptureRectangleTransparent(safeTaskSettings, false);
                break;

            case HotkeyType.CustomRegion:
                CaptureTaskHelpers.CaptureScreenshot(CaptureType.CustomRegion, safeTaskSettings, false);
                break;

            case HotkeyType.LastRegion:
                CaptureTaskHelpers.CaptureScreenshot(CaptureType.LastRegion, safeTaskSettings, false);
                break;

            case HotkeyType.ScrollingCapture:
                OpenScrollingCapture(safeTaskSettings, true);
                break;

            case HotkeyType.CaptureWebpage:
                OpenWebpageCapture(safeTaskSettings);
                break;

            case HotkeyType.AutoCapture:
                OpenAutoCapture();
                break;

            case HotkeyType.StartAutoCapture:
                StartAutoCapture();
                break;

            // Screen record
            case HotkeyType.ScreenRecorder:
                StartScreenRecording(ScreenRecordOutput.FFmpeg, ScreenRecordStartMethod.Region, safeTaskSettings);
                break;

            case HotkeyType.ScreenRecorderActiveWindow:
                StartScreenRecording(ScreenRecordOutput.FFmpeg, ScreenRecordStartMethod.ActiveWindow, safeTaskSettings);
                break;

            case HotkeyType.ScreenRecorderCustomRegion:
                StartScreenRecording(ScreenRecordOutput.FFmpeg, ScreenRecordStartMethod.CustomRegion, safeTaskSettings);
                break;

            case HotkeyType.StartScreenRecorder:
                StartScreenRecording(ScreenRecordOutput.FFmpeg, ScreenRecordStartMethod.LastRegion, safeTaskSettings);
                break;

            case HotkeyType.ScreenRecorderGIF:
                StartScreenRecording(ScreenRecordOutput.GIF, ScreenRecordStartMethod.Region, safeTaskSettings);
                break;

            case HotkeyType.ScreenRecorderGIFActiveWindow:
                StartScreenRecording(ScreenRecordOutput.GIF, ScreenRecordStartMethod.ActiveWindow, safeTaskSettings);
                break;

            case HotkeyType.ScreenRecorderGIFCustomRegion:
                StartScreenRecording(ScreenRecordOutput.GIF, ScreenRecordStartMethod.CustomRegion, safeTaskSettings);
                break;

            case HotkeyType.StartScreenRecorderGIF:
                StartScreenRecording(ScreenRecordOutput.GIF, ScreenRecordStartMethod.LastRegion, safeTaskSettings);
                break;

            case HotkeyType.AbortScreenRecording:
                AbortScreenRecording();
                break;

            // Tools
            case HotkeyType.ColorPicker:
                OpenColorPicker();
                break;

            case HotkeyType.ScreenColorPicker:
                OpenScreenColorPicker(safeTaskSettings);
                break;

            case HotkeyType.ImageEditor:
                if (command != null && !string.IsNullOrEmpty(command.Parameter) && File.Exists(command.Parameter))
                {
                    AnnotateImage(command.Parameter, safeTaskSettings);
                }
                else
                {
                    AnnotateImage(safeTaskSettings);
                }
                break;

                break;

            case HotkeyType.HashCheck:
                OpenHashCheck();
                break;

            case HotkeyType.DNSChanger:
                OpenDNSChanger();
                break;

            case HotkeyType.IndexFolder:

                break;

            case HotkeyType.ImageCombiner:
                OpenImageCombiner(safeTaskSettings);
                break;

            case HotkeyType.VideoThumbnailer:
                OpenVideoThumbnailer(safeTaskSettings);
                break;

            // Other
            case HotkeyType.DisableHotkeys:
                ToggleHotkeys();
                break;

            case HotkeyType.ToggleActionsToolbar:
                ToggleActionsToolbar();
                break;
            }
        }
Esempio n. 5
0
        public static void ExecuteJob(TaskSettings taskSettings, HotkeyType job, CLICommand command = null)
        {
            if (job == HotkeyType.None)
            {
                return;
            }

            DebugHelper.WriteLine("Executing: " + job.GetLocalizedDescription());

            TaskSettings safeTaskSettings = TaskSettings.GetSafeTaskSettings(taskSettings);

            switch (job)
            {
            // Screen capture
            case HotkeyType.PrintScreen:
                new CaptureFullscreen().Capture(safeTaskSettings);
                break;

            case HotkeyType.ActiveWindow:
                new CaptureActiveWindow().Capture(safeTaskSettings);
                break;

            case HotkeyType.ActiveMonitor:
                new CaptureActiveMonitor().Capture(safeTaskSettings);
                break;

            case HotkeyType.RectangleRegion:
                new CaptureRegion().Capture(safeTaskSettings);
                break;

            case HotkeyType.RectangleLight:
                new CaptureRegion(RegionCaptureType.Light).Capture(safeTaskSettings);
                break;

            case HotkeyType.RectangleTransparent:
                new CaptureRegion(RegionCaptureType.Transparent).Capture(safeTaskSettings);
                break;

            case HotkeyType.CustomRegion:
                new CaptureCustomRegion().Capture(safeTaskSettings);
                break;

            case HotkeyType.LastRegion:
                new CaptureLastRegion().Capture(safeTaskSettings);
                break;

            case HotkeyType.ScrollingCapture:
                OpenScrollingCapture(safeTaskSettings, true);
                break;

            case HotkeyType.AutoCapture:
                OpenAutoCapture(safeTaskSettings);
                break;

            case HotkeyType.StartAutoCapture:
                StartAutoCapture(safeTaskSettings);
                break;

            // Tools
            case HotkeyType.ColorPicker:
                ShowScreenColorPickerDialog(safeTaskSettings);
                break;

            case HotkeyType.ScreenColorPicker:
                OpenScreenColorPicker(safeTaskSettings);
                break;

            case HotkeyType.ImageEditor:
                if (command != null && !string.IsNullOrEmpty(command.Parameter) && File.Exists(command.Parameter))
                {
                    AnnotateImageFromFile(command.Parameter, safeTaskSettings);
                }
                else
                {
                    OpenImageEditor(safeTaskSettings);
                }
                break;

            case HotkeyType.HashCheck:
                OpenHashCheck();
                break;

            case HotkeyType.DNSChanger:
                OpenDNSChanger();
                break;

            case HotkeyType.Ruler:
                OpenRuler(safeTaskSettings);
                break;

            case HotkeyType.MonitorTest:
                OpenMonitorTest();
                break;

            // Other
            case HotkeyType.DisableHotkeys:
                ToggleHotkeys();
                break;

            case HotkeyType.OpenScreenshotsFolder:
                OpenScreenshotsFolder();
                break;

            case HotkeyType.OpenHistory:
                OpenHistory();
                break;

            case HotkeyType.OpenImageHistory:
                OpenImageHistory();
                break;

            case HotkeyType.ToggleActionsToolbar:
                ToggleActionsToolbar();
                break;
            }
        }