mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Optimizing the windows logic, as far as was possible without LINQ. Added a check to try to fix BUG-2017.
This commit is contained in:
parent
68f0926b4d
commit
d446127e19
5 changed files with 316 additions and 315 deletions
|
@ -71,19 +71,19 @@ namespace Greenshot.Helpers {
|
|||
/// <summary>
|
||||
/// Helper Method for creating an Email with Image Attachment
|
||||
/// </summary>
|
||||
/// <param name="image">The image to send</param>
|
||||
/// <param name="surface">The image to send</param>
|
||||
/// <param name="captureDetails">ICaptureDetails</param>
|
||||
public static void SendImage(ISurface surface, ICaptureDetails captureDetails) {
|
||||
string tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new SurfaceOutputSettings());
|
||||
|
||||
if (tmpFile != null) {
|
||||
// Store the list of currently active windows, so we can make sure we show the email window later!
|
||||
List<WindowDetails> windowsBefore = WindowDetails.GetVisibleWindows();
|
||||
bool isEmailSend = false;
|
||||
var windowsBefore = WindowDetails.GetVisibleWindows();
|
||||
//bool isEmailSend = false;
|
||||
//if (EmailConfigHelper.HasOutlook() && (conf.OutputEMailFormat == EmailFormat.OUTLOOK_HTML || conf.OutputEMailFormat == EmailFormat.OUTLOOK_TXT)) {
|
||||
// isEmailSend = OutlookExporter.ExportToOutlook(tmpFile, captureDetails);
|
||||
//}
|
||||
if (!isEmailSend && EmailConfigHelper.HasMAPI()) {
|
||||
if (/*!isEmailSend &&*/ EmailConfigHelper.HasMAPI()) {
|
||||
// Fallback to MAPI
|
||||
// Send the email
|
||||
SendImage(tmpFile, captureDetails.Title);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue