|
21 | 21 | using SnapX.Core; |
22 | 22 | using SnapX.Core.Capture; |
23 | 23 | using SnapX.Core.Job; |
| 24 | +using SnapX.Core.Upload; |
24 | 25 | using SnapX.Core.Utils; |
25 | 26 | using SnapX.Core.Utils.Native; |
26 | 27 |
|
@@ -513,19 +514,46 @@ private void NativeMenuItem_SnapX_OnClick(object? Sender, EventArgs E) |
513 | 514 | NativeMenuAboutSnapXClick(Sender, E); |
514 | 515 | } |
515 | 516 |
|
516 | | - private void NativeMenuItem_Capture_Fullscreen_OnClick(object? Sender, EventArgs E) |
| 517 | + private async void NativeMenuItem_Capture_Fullscreen_OnClick(object? Sender, EventArgs E) |
517 | 518 | { |
518 | | - TaskHelpers.GetScreenshot().CaptureFullscreen(); |
| 519 | + await Task.Factory.StartNew( |
| 520 | + () => |
| 521 | + { |
| 522 | + UploadManager.RunImageTask( |
| 523 | + TaskHelpers.GetScreenshot().CaptureFullscreen(), |
| 524 | + TaskSettings.GetDefaultTaskSettings() |
| 525 | + ); |
| 526 | + }, |
| 527 | + CancellationToken.None, |
| 528 | + TaskCreationOptions.LongRunning, |
| 529 | + TaskScheduler.Default |
| 530 | + ); |
519 | 531 | } |
520 | 532 |
|
521 | | - private void NativeMenuItem_Workflows_CaptureActiveScreen_OnClick(object? Sender, EventArgs E) |
| 533 | + private async void NativeMenuItem_Workflows_CaptureActiveScreen_OnClick(object? Sender, EventArgs E) |
522 | 534 | { |
523 | | - new CaptureActiveMonitor().Capture(TaskSettings.GetDefaultTaskSettings()); |
| 535 | + await Task.Factory.StartNew( |
| 536 | + () => |
| 537 | + { |
| 538 | + new CaptureActiveMonitor().Capture(TaskSettings.GetDefaultTaskSettings()); |
| 539 | + }, |
| 540 | + CancellationToken.None, |
| 541 | + TaskCreationOptions.LongRunning, |
| 542 | + TaskScheduler.Default |
| 543 | + ); |
524 | 544 | } |
525 | 545 |
|
526 | | - private void NativeMenuItem_Workflows_CaptureActiveWindow_OnClick(object? Sender, EventArgs E) |
| 546 | + private async void NativeMenuItem_Workflows_CaptureActiveWindow_OnClick(object? Sender, EventArgs E) |
527 | 547 | { |
528 | | - new CaptureActiveWindow().Capture(TaskSettings.GetDefaultTaskSettings()); |
| 548 | + await Task.Factory.StartNew( |
| 549 | + () => |
| 550 | + { |
| 551 | + new CaptureActiveWindow().Capture(TaskSettings.GetDefaultTaskSettings()); |
| 552 | + }, |
| 553 | + CancellationToken.None, |
| 554 | + TaskCreationOptions.LongRunning, |
| 555 | + TaskScheduler.Default |
| 556 | + ); |
529 | 557 | } |
530 | 558 |
|
531 | 559 | private void NativeMenuItem_Open_OnClick(object? Sender, EventArgs E) |
|
0 commit comments