#268 coded - proposition

This commit is contained in:
Krzysztof 2021-02-04 16:19:18 +01:00
commit 0f6d374170
3 changed files with 14 additions and 1 deletions

View file

@ -64,6 +64,8 @@ namespace Greenshot.Destinations {
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(Designation, Description);
// close the form after copying the image to clipboard
exportInformation.CloseForm = true;
try {
ClipboardHelper.SetClipboardData(surface);
exportInformation.ExportMade = true;

View file

@ -932,7 +932,11 @@ namespace Greenshot {
}
if (destination.EditorShortcutKeys == keys) {
destination.ExportCapture(true, _surface, _surface.CaptureDetails);
ExportInformation exportInformation = destination.ExportCapture(true, _surface, _surface.CaptureDetails);
if (exportInformation != null && exportInformation.ExportMade) {
if (exportInformation.CloseForm)
this.Close();
}
return true;
}
}
@ -1273,6 +1277,8 @@ namespace Greenshot {
ExportInformation exportInformation = clickedDestination?.ExportCapture(true, _surface, _surface.CaptureDetails);
if (exportInformation != null && exportInformation.ExportMade) {
_surface.Modified = false;
if (exportInformation.CloseForm)
this.Close();
}
}

View file

@ -48,6 +48,11 @@ namespace GreenshotPlugin.Interfaces {
public string ErrorMessage { get; set; }
public string Filepath { get; set; }
/// <summary>
/// Set to true to close the invoking form.
/// </summary>
public bool CloseForm { get; set; }
}
/// <summary>