mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43: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
|
@ -93,7 +93,8 @@ namespace Greenshot.Destinations {
|
|||
}
|
||||
}
|
||||
|
||||
public override bool ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
|
||||
PrinterSettings printerSettings = null;
|
||||
using (Image image = surface.GetImageForExport()) {
|
||||
if (!string.IsNullOrEmpty(printerName)) {
|
||||
|
@ -105,12 +106,15 @@ namespace Greenshot.Destinations {
|
|||
printerSettings = new PrintHelper(image, captureDetails).PrintWithDialog();
|
||||
}
|
||||
if (printerSettings != null) {
|
||||
surface.Modified = false;
|
||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, Language.GetFormattedString(LangKey.editor_senttoprinter, printerSettings.PrinterName));
|
||||
printerName = printerSettings.PrinterName;
|
||||
// Renew destination
|
||||
exportInformation.DestinationDescription = this.Description;
|
||||
exportInformation.ExportMade = true;
|
||||
}
|
||||
}
|
||||
|
||||
return printerSettings != null;
|
||||
ProcessExport(exportInformation, surface);
|
||||
return exportInformation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue