mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 05:23:24 -07:00
Extended the ExportCapture with ExportInformation as a result object, this allows us to better and more consistently return & handle information from the export. Also it should be easier to extend the functionality. TODO: Still need to cleanup some messages, some are no longer needed
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2034 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
f3d376ee71
commit
be797ecf8a
27 changed files with 379 additions and 172 deletions
|
@ -128,18 +128,19 @@ namespace Greenshot.Helpers {
|
|||
/// <param name="designation"></param>
|
||||
/// <param name="surface"></param>
|
||||
/// <param name="captureDetails"></param>
|
||||
public static void ExportCapture(bool manuallyInitiated, string designation, ISurface surface, ICaptureDetails captureDetails) {
|
||||
if (RegisteredDestinations.ContainsKey(designation)) {
|
||||
IDestination destination = RegisteredDestinations[designation];
|
||||
if (destination.isActive) {
|
||||
if (destination.ExportCapture(manuallyInitiated, surface, captureDetails)) {
|
||||
// Export worked, set the modified flag to false if the export wasn't to the editor or picker
|
||||
if (!EditorDestination.DESIGNATION.Equals(designation) && !PickerDestination.DESIGNATION.Equals(designation)) {
|
||||
surface.Modified = false;
|
||||
}
|
||||
public static ExportInformation ExportCapture(bool manuallyInitiated, string designation, ISurface surface, ICaptureDetails captureDetails) {
|
||||
IDestination destination = GetDestination(designation);
|
||||
if (destination != null && destination.isActive) {
|
||||
ExportInformation exportInformation = destination.ExportCapture(manuallyInitiated, surface, captureDetails);
|
||||
if (exportInformation != null && exportInformation.ExportMade) {
|
||||
// Export worked, set the modified flag to false if the export wasn't to the editor or picker
|
||||
if (!EditorDestination.DESIGNATION.Equals(designation) && !PickerDestination.DESIGNATION.Equals(designation)) {
|
||||
surface.Modified = false;
|
||||
}
|
||||
}
|
||||
return exportInformation;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue