mirror of
https://github.com/greenshot/greenshot
synced 2025-08-22 22:34:27 -07:00
Small changes reducing code, and to make the export window a bit nicer.
This commit is contained in:
parent
586082fe71
commit
4fae9d3d89
33 changed files with 198 additions and 217 deletions
|
@ -56,7 +56,8 @@ namespace Greenshot.Addon.Box
|
||||||
public class BoxDestination : AbstractDestination
|
public class BoxDestination : AbstractDestination
|
||||||
{
|
{
|
||||||
private static readonly LogSource Log = new LogSource();
|
private static readonly LogSource Log = new LogSource();
|
||||||
private readonly IBoxConfiguration _boxConfiguration;
|
private readonly ExportNotification _exportNotification;
|
||||||
|
private readonly IBoxConfiguration _boxConfiguration;
|
||||||
private readonly IBoxLanguage _boxLanguage;
|
private readonly IBoxLanguage _boxLanguage;
|
||||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||||
private readonly INetworkConfiguration _networkConfiguration;
|
private readonly INetworkConfiguration _networkConfiguration;
|
||||||
|
@ -73,8 +74,9 @@ namespace Greenshot.Addon.Box
|
||||||
IBoxLanguage boxLanguage,
|
IBoxLanguage boxLanguage,
|
||||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||||
INetworkConfiguration networkConfiguration,
|
INetworkConfiguration networkConfiguration,
|
||||||
IResourceProvider resourceProvider) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
IResourceProvider resourceProvider) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
|
_exportNotification = exportNotification;
|
||||||
_boxConfiguration = boxConfiguration;
|
_boxConfiguration = boxConfiguration;
|
||||||
_boxLanguage = boxLanguage;
|
_boxLanguage = boxLanguage;
|
||||||
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
||||||
|
@ -125,7 +127,7 @@ namespace Greenshot.Addon.Box
|
||||||
exportInformation.ExportMade = true;
|
exportInformation.ExportMade = true;
|
||||||
exportInformation.Uri = uploadUrl;
|
exportInformation.Uri = uploadUrl;
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace Greenshot.Addon.Confluence
|
||||||
IConfluenceConfiguration confluenceConfiguration,
|
IConfluenceConfiguration confluenceConfiguration,
|
||||||
IConfluenceLanguage confluenceLanguage,
|
IConfluenceLanguage confluenceLanguage,
|
||||||
Func<Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
Func<Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_exportNotification = exportNotification;
|
_exportNotification = exportNotification;
|
||||||
_confluenceConfiguration = confluenceConfiguration;
|
_confluenceConfiguration = confluenceConfiguration;
|
||||||
|
@ -180,8 +180,8 @@ namespace Greenshot.Addon.Confluence
|
||||||
exportInformation.ErrorMessage = errorMessage;
|
exportInformation.ErrorMessage = errorMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool Upload(ISurface surfaceToUpload, Content page, string filename, out string errorMessage)
|
private bool Upload(ISurface surfaceToUpload, Content page, string filename, out string errorMessage)
|
||||||
|
|
|
@ -63,6 +63,7 @@ namespace Greenshot.Addon.Dropbox
|
||||||
private readonly IDropboxConfiguration _dropboxPluginConfiguration;
|
private readonly IDropboxConfiguration _dropboxPluginConfiguration;
|
||||||
private readonly IDropboxLanguage _dropboxLanguage;
|
private readonly IDropboxLanguage _dropboxLanguage;
|
||||||
private readonly IResourceProvider _resourceProvider;
|
private readonly IResourceProvider _resourceProvider;
|
||||||
|
private readonly ExportNotification _exportNotification;
|
||||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||||
private OAuth2Settings _oAuth2Settings;
|
private OAuth2Settings _oAuth2Settings;
|
||||||
private IHttpBehaviour _oAuthHttpBehaviour;
|
private IHttpBehaviour _oAuthHttpBehaviour;
|
||||||
|
@ -76,11 +77,12 @@ namespace Greenshot.Addon.Dropbox
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification,
|
ExportNotification exportNotification,
|
||||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_dropboxPluginConfiguration = dropboxPluginConfiguration;
|
_dropboxPluginConfiguration = dropboxPluginConfiguration;
|
||||||
_dropboxLanguage = dropboxLanguage;
|
_dropboxLanguage = dropboxLanguage;
|
||||||
_resourceProvider = resourceProvider;
|
_resourceProvider = resourceProvider;
|
||||||
|
_exportNotification = exportNotification;
|
||||||
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
||||||
|
|
||||||
_oAuth2Settings = new OAuth2Settings
|
_oAuth2Settings = new OAuth2Settings
|
||||||
|
@ -140,7 +142,7 @@ namespace Greenshot.Addon.Dropbox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,17 +50,19 @@ namespace Greenshot.Addon.ExternalCommand
|
||||||
|
|
||||||
private readonly ExternalCommandDefinition _externalCommandDefinition;
|
private readonly ExternalCommandDefinition _externalCommandDefinition;
|
||||||
private readonly IExternalCommandConfiguration _externalCommandConfiguration;
|
private readonly IExternalCommandConfiguration _externalCommandConfiguration;
|
||||||
|
private readonly ExportNotification _exportNotification;
|
||||||
|
|
||||||
public ExternalCommandDestination(ExternalCommandDefinition defintion,
|
public ExternalCommandDestination(ExternalCommandDefinition defintion,
|
||||||
IExternalCommandConfiguration externalCommandConfiguration,
|
IExternalCommandConfiguration externalCommandConfiguration,
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_externalCommandDefinition = defintion;
|
_externalCommandDefinition = defintion;
|
||||||
_externalCommandConfiguration = externalCommandConfiguration;
|
_externalCommandConfiguration = externalCommandConfiguration;
|
||||||
}
|
_exportNotification = exportNotification;
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string Designation => "External " + _externalCommandDefinition.Name.Replace(',', '_');
|
public override string Designation => "External " + _externalCommandDefinition.Name.Replace(',', '_');
|
||||||
|
@ -108,8 +110,8 @@ namespace Greenshot.Addon.ExternalCommand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -64,6 +64,7 @@ namespace Greenshot.Addon.Flickr
|
||||||
private readonly IFlickrConfiguration _flickrConfiguration;
|
private readonly IFlickrConfiguration _flickrConfiguration;
|
||||||
private readonly IFlickrLanguage _flickrLanguage;
|
private readonly IFlickrLanguage _flickrLanguage;
|
||||||
private readonly IResourceProvider _resourceProvider;
|
private readonly IResourceProvider _resourceProvider;
|
||||||
|
private readonly ExportNotification _exportNotification;
|
||||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||||
private readonly OAuth1Settings _oAuthSettings;
|
private readonly OAuth1Settings _oAuthSettings;
|
||||||
private readonly OAuth1HttpBehaviour _oAuthHttpBehaviour;
|
private readonly OAuth1HttpBehaviour _oAuthHttpBehaviour;
|
||||||
|
@ -88,11 +89,12 @@ namespace Greenshot.Addon.Flickr
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification,
|
ExportNotification exportNotification,
|
||||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_flickrConfiguration = flickrConfiguration;
|
_flickrConfiguration = flickrConfiguration;
|
||||||
_flickrLanguage = flickrLanguage;
|
_flickrLanguage = flickrLanguage;
|
||||||
_resourceProvider = resourceProvider;
|
_resourceProvider = resourceProvider;
|
||||||
|
_exportNotification = exportNotification;
|
||||||
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
||||||
|
|
||||||
_oAuthSettings = new OAuth1Settings
|
_oAuthSettings = new OAuth1Settings
|
||||||
|
@ -147,8 +149,8 @@ namespace Greenshot.Addon.Flickr
|
||||||
ExportMade = flickrUri != null,
|
ExportMade = flickrUri != null,
|
||||||
Uri = flickrUri
|
Uri = flickrUri
|
||||||
};
|
};
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ namespace Greenshot.Addon.GooglePhotos
|
||||||
private readonly IGooglePhotosLanguage _googlePhotosLanguage;
|
private readonly IGooglePhotosLanguage _googlePhotosLanguage;
|
||||||
private readonly INetworkConfiguration _networkConfiguration;
|
private readonly INetworkConfiguration _networkConfiguration;
|
||||||
private readonly IResourceProvider _resourceProvider;
|
private readonly IResourceProvider _resourceProvider;
|
||||||
|
private readonly ExportNotification _exportNotification;
|
||||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||||
private readonly OAuth2Settings _oAuth2Settings;
|
private readonly OAuth2Settings _oAuth2Settings;
|
||||||
|
|
||||||
|
@ -71,12 +72,13 @@ namespace Greenshot.Addon.GooglePhotos
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification,
|
ExportNotification exportNotification,
|
||||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_googlePhotosConfiguration = googlePhotosConfiguration;
|
_googlePhotosConfiguration = googlePhotosConfiguration;
|
||||||
_googlePhotosLanguage = googlePhotosLanguage;
|
_googlePhotosLanguage = googlePhotosLanguage;
|
||||||
_networkConfiguration = networkConfiguration;
|
_networkConfiguration = networkConfiguration;
|
||||||
_resourceProvider = resourceProvider;
|
_resourceProvider = resourceProvider;
|
||||||
|
_exportNotification = exportNotification;
|
||||||
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
||||||
|
|
||||||
_oAuth2Settings = new OAuth2Settings
|
_oAuth2Settings = new OAuth2Settings
|
||||||
|
@ -123,8 +125,8 @@ namespace Greenshot.Addon.GooglePhotos
|
||||||
exportInformation.ExportMade = true;
|
exportInformation.ExportMade = true;
|
||||||
exportInformation.Uri = uploadUrl;
|
exportInformation.Uri = uploadUrl;
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<string> Upload(ISurface surfaceToUpload)
|
private async Task<string> Upload(ISurface surfaceToUpload)
|
||||||
|
|
|
@ -54,7 +54,8 @@ namespace Greenshot.Addon.Imgur
|
||||||
public class ImgurDestination : AbstractDestination
|
public class ImgurDestination : AbstractDestination
|
||||||
{
|
{
|
||||||
private static readonly LogSource Log = new LogSource();
|
private static readonly LogSource Log = new LogSource();
|
||||||
private readonly IImgurConfiguration _imgurConfiguration;
|
private readonly ExportNotification _exportNotification;
|
||||||
|
private readonly IImgurConfiguration _imgurConfiguration;
|
||||||
private readonly IImgurLanguage _imgurLanguage;
|
private readonly IImgurLanguage _imgurLanguage;
|
||||||
private readonly ImgurApi _imgurApi;
|
private readonly ImgurApi _imgurApi;
|
||||||
private readonly ImgurHistoryViewModel _imgurHistoryViewModel;
|
private readonly ImgurHistoryViewModel _imgurHistoryViewModel;
|
||||||
|
@ -70,9 +71,10 @@ namespace Greenshot.Addon.Imgur
|
||||||
ImgurApi imgurApi,
|
ImgurApi imgurApi,
|
||||||
ImgurHistoryViewModel imgurHistoryViewModel,
|
ImgurHistoryViewModel imgurHistoryViewModel,
|
||||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||||
IResourceProvider resourceProvider) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
IResourceProvider resourceProvider) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_imgurConfiguration = imgurConfiguration;
|
_exportNotification = exportNotification;
|
||||||
|
_imgurConfiguration = imgurConfiguration;
|
||||||
_imgurLanguage = imgurLanguage;
|
_imgurLanguage = imgurLanguage;
|
||||||
_imgurApi = imgurApi;
|
_imgurApi = imgurApi;
|
||||||
_imgurHistoryViewModel = imgurHistoryViewModel;
|
_imgurHistoryViewModel = imgurHistoryViewModel;
|
||||||
|
@ -103,8 +105,8 @@ namespace Greenshot.Addon.Imgur
|
||||||
ExportMade = uploadUrl != null,
|
ExportMade = uploadUrl != null,
|
||||||
Uri = uploadUrl?.AbsoluteUri
|
Uri = uploadUrl?.AbsoluteUri
|
||||||
};
|
};
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace Greenshot.Addon.Jira
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_jiraConfiguration = jiraConfiguration;
|
_jiraConfiguration = jiraConfiguration;
|
||||||
_jiraLanguage = jiraLanguage;
|
_jiraLanguage = jiraLanguage;
|
||||||
|
@ -239,8 +239,8 @@ namespace Greenshot.Addon.Jira
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -59,7 +59,7 @@ namespace Greenshot.Addon.LegacyEditor
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification,
|
ExportNotification exportNotification,
|
||||||
EditorFactory editorFactory,
|
EditorFactory editorFactory,
|
||||||
IEditorLanguage editorLanguage) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
IEditorLanguage editorLanguage) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_exportNotification = exportNotification;
|
_exportNotification = exportNotification;
|
||||||
_editorFactory = editorFactory;
|
_editorFactory = editorFactory;
|
||||||
|
@ -129,10 +129,10 @@ namespace Greenshot.Addon.LegacyEditor
|
||||||
_editorFactory.CreateOrReuse(surface, captureDetails);
|
_editorFactory.CreateOrReuse(surface, captureDetails);
|
||||||
exportInformation.ExportMade = true;
|
exportInformation.ExportMade = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
// Workaround for the modified flag when using the editor.
|
// Workaround for the modified flag when using the editor.
|
||||||
surface.Modified = modified;
|
surface.Modified = modified;
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ namespace Greenshot.Addon.Lutim {
|
||||||
private readonly ILutimLanguage _lutimLanguage;
|
private readonly ILutimLanguage _lutimLanguage;
|
||||||
private readonly LutimApi _lutimApi;
|
private readonly LutimApi _lutimApi;
|
||||||
private readonly IResourceProvider _resourceProvider;
|
private readonly IResourceProvider _resourceProvider;
|
||||||
|
private readonly ExportNotification _exportNotification;
|
||||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||||
|
|
||||||
public LutimDestination(ILutimConfiguration lutimConfiguration,
|
public LutimDestination(ILutimConfiguration lutimConfiguration,
|
||||||
|
@ -59,12 +60,13 @@ namespace Greenshot.Addon.Lutim {
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification,
|
ExportNotification exportNotification,
|
||||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_lutimConfiguration = lutimConfiguration;
|
_lutimConfiguration = lutimConfiguration;
|
||||||
_lutimLanguage = lutimLanguage;
|
_lutimLanguage = lutimLanguage;
|
||||||
_lutimApi = lutimApi;
|
_lutimApi = lutimApi;
|
||||||
_resourceProvider = resourceProvider;
|
_resourceProvider = resourceProvider;
|
||||||
|
_exportNotification = exportNotification;
|
||||||
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,8 +91,8 @@ namespace Greenshot.Addon.Lutim {
|
||||||
ExportMade = uploadUrl != null,
|
ExportMade = uploadUrl != null,
|
||||||
Uri = uploadUrl
|
Uri = uploadUrl
|
||||||
};
|
};
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ namespace Greenshot.Addon.OCR
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_ocrConfiguration = ocrConfiguration;
|
_ocrConfiguration = ocrConfiguration;
|
||||||
|
|
||||||
var ocrDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
var ocrDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace Greenshot.Addon.Office.Destinations
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_exportNotification = exportNotification;
|
_exportNotification = exportNotification;
|
||||||
_exePath = PluginUtils.GetExePath("EXCEL.EXE");
|
_exePath = PluginUtils.GetExePath("EXCEL.EXE");
|
||||||
|
@ -111,9 +111,9 @@ namespace Greenshot.Addon.Office.Destinations
|
||||||
ExcelExporter.InsertIntoNewWorkbook(imageFile, surface.Screenshot.Size);
|
ExcelExporter.InsertIntoNewWorkbook(imageFile, surface.Screenshot.Size);
|
||||||
}
|
}
|
||||||
exportInformation.ExportMade = true;
|
exportInformation.ExportMade = true;
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
// Cleanup imageFile if we created it here, so less tmp-files are generated and left
|
// Cleanup imageFile if we created it here, so less tmp-files are generated and left
|
||||||
if (createdFile)
|
if (createdFile)
|
||||||
{
|
{
|
||||||
ImageOutput.DeleteNamedTmpFile(imageFile);
|
ImageOutput.DeleteNamedTmpFile(imageFile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace Greenshot.Addon.Office.Destinations
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_exportNotification = exportNotification;
|
_exportNotification = exportNotification;
|
||||||
_exePath = PluginUtils.GetExePath("ONENOTE.EXE");
|
_exePath = PluginUtils.GetExePath("ONENOTE.EXE");
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace Greenshot.Addon.Office.Destinations
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_officeConfiguration = officeConfiguration;
|
_officeConfiguration = officeConfiguration;
|
||||||
_exportNotification = exportNotification;
|
_exportNotification = exportNotification;
|
||||||
|
@ -198,8 +198,8 @@ namespace Greenshot.Addon.Office.Destinations
|
||||||
_officeConfiguration.EmailBCC, null);
|
_officeConfiguration.EmailBCC, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -57,7 +57,7 @@ namespace Greenshot.Addon.Office.Destinations
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_exportNotification = exportNotification;
|
_exportNotification = exportNotification;
|
||||||
_exePath = PluginUtils.GetExePath("POWERPNT.EXE");
|
_exePath = PluginUtils.GetExePath("POWERPNT.EXE");
|
||||||
|
@ -144,8 +144,8 @@ namespace Greenshot.Addon.Office.Destinations
|
||||||
exportInformation.ExportMade = PowerpointExporter.InsertIntoNewPresentation(tmpFile, imageSize, captureDetails.Title);
|
exportInformation.ExportMade = PowerpointExporter.InsertIntoNewPresentation(tmpFile, imageSize, captureDetails.Title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -58,7 +58,7 @@ namespace Greenshot.Addon.Office.Destinations
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_exportNotification = exportNotification;
|
_exportNotification = exportNotification;
|
||||||
_exePath = PluginUtils.GetExePath("WINWORD.EXE");
|
_exePath = PluginUtils.GetExePath("WINWORD.EXE");
|
||||||
|
@ -162,8 +162,8 @@ namespace Greenshot.Addon.Office.Destinations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -63,6 +63,7 @@ namespace Greenshot.Addon.OneDrive
|
||||||
private readonly IOneDriveLanguage _oneDriveLanguage;
|
private readonly IOneDriveLanguage _oneDriveLanguage;
|
||||||
private readonly IResourceProvider _resourceProvider;
|
private readonly IResourceProvider _resourceProvider;
|
||||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||||
|
private readonly ExportNotification _exportNotification;
|
||||||
private readonly OAuth2Settings _oauth2Settings;
|
private readonly OAuth2Settings _oauth2Settings;
|
||||||
private static readonly Uri GraphUri = new Uri("https://graph.microsoft.com");
|
private static readonly Uri GraphUri = new Uri("https://graph.microsoft.com");
|
||||||
private static readonly Uri OneDriveUri = GraphUri.AppendSegments("v1.0", "me", "drive");
|
private static readonly Uri OneDriveUri = GraphUri.AppendSegments("v1.0", "me", "drive");
|
||||||
|
@ -79,12 +80,13 @@ namespace Greenshot.Addon.OneDrive
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_oneDriveConfiguration = oneDriveConfiguration;
|
_oneDriveConfiguration = oneDriveConfiguration;
|
||||||
_oneDriveLanguage = oneDriveLanguage;
|
_oneDriveLanguage = oneDriveLanguage;
|
||||||
_resourceProvider = resourceProvider;
|
_resourceProvider = resourceProvider;
|
||||||
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
||||||
|
_exportNotification = exportNotification;
|
||||||
// Configure the OAuth2 settings for OneDrive communication
|
// Configure the OAuth2 settings for OneDrive communication
|
||||||
_oauth2Settings = new OAuth2Settings
|
_oauth2Settings = new OAuth2Settings
|
||||||
{
|
{
|
||||||
|
@ -136,7 +138,7 @@ namespace Greenshot.Addon.OneDrive
|
||||||
ExportMade = uploadUrl != null,
|
ExportMade = uploadUrl != null,
|
||||||
Uri = uploadUrl?.AbsoluteUri
|
Uri = uploadUrl?.AbsoluteUri
|
||||||
};
|
};
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,9 +241,11 @@ namespace Greenshot.Addon.OneDrive
|
||||||
var localBehaviour = _oneDriveHttpBehaviour.ShallowClone();
|
var localBehaviour = _oneDriveHttpBehaviour.ShallowClone();
|
||||||
var oauthHttpBehaviour = OAuth2HttpBehaviourFactory.Create(oAuth2Settings, localBehaviour);
|
var oauthHttpBehaviour = OAuth2HttpBehaviourFactory.Create(oAuth2Settings, localBehaviour);
|
||||||
oauthHttpBehaviour.MakeCurrent();
|
oauthHttpBehaviour.MakeCurrent();
|
||||||
var body = new OneDriveGetLinkRequest();
|
var body = new OneDriveGetLinkRequest
|
||||||
body.Scope = oneDriveLinkType == OneDriveLinkType.@public ? "anonymous" : "organization";
|
{
|
||||||
body.Type = "view";
|
Scope = oneDriveLinkType == OneDriveLinkType.@public ? "anonymous" : "organization",
|
||||||
|
Type = "view"
|
||||||
|
};
|
||||||
return await sharableLink.PostAsync<OneDriveGetLinkResponse>(body);
|
return await sharableLink.PostAsync<OneDriveGetLinkResponse>(body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace Greenshot.Addon.Photobucket
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_photobucketConfiguration = photobucketConfiguration;
|
_photobucketConfiguration = photobucketConfiguration;
|
||||||
_photobucketLanguage = photobucketLanguage;
|
_photobucketLanguage = photobucketLanguage;
|
||||||
|
@ -230,8 +230,8 @@ namespace Greenshot.Addon.Photobucket
|
||||||
exportInformation.ExportMade = true;
|
exportInformation.ExportMade = true;
|
||||||
exportInformation.Uri = uploaded.Original;
|
exportInformation.Uri = uploaded.Original;
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace Greenshot.Addon.Tfs
|
||||||
TfsClient tfsClient,
|
TfsClient tfsClient,
|
||||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||||
IResourceProvider resourceProvider,
|
IResourceProvider resourceProvider,
|
||||||
ExportNotification exportNotification) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
ExportNotification exportNotification) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_tfsConfiguration = tfsConfiguration;
|
_tfsConfiguration = tfsConfiguration;
|
||||||
_tfsLanguage = tfsLanguage;
|
_tfsLanguage = tfsLanguage;
|
||||||
|
@ -165,7 +165,7 @@ namespace Greenshot.Addon.Tfs
|
||||||
ExportMade = uploadUrl != null,
|
ExportMade = uploadUrl != null,
|
||||||
Uri = uploadUrl?.AbsoluteUri
|
Uri = uploadUrl?.AbsoluteUri
|
||||||
};
|
};
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,12 +39,12 @@ namespace Greenshot.Addons.Components
|
||||||
private static readonly LogSource Log = new LogSource();
|
private static readonly LogSource Log = new LogSource();
|
||||||
private readonly ICoreConfiguration _coreConfiguration;
|
private readonly ICoreConfiguration _coreConfiguration;
|
||||||
private readonly IEventAggregator _eventAggregator;
|
private readonly IEventAggregator _eventAggregator;
|
||||||
private readonly Func<IDestination, ExportInformation, Owned<ExportNotificationViewModel>> _toastFactory;
|
private readonly Func<IDestination, ExportInformation, ISurface, Owned<ExportNotificationViewModel>> _toastFactory;
|
||||||
|
|
||||||
public ExportNotification(
|
public ExportNotification(
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IEventAggregator eventAggregator,
|
IEventAggregator eventAggregator,
|
||||||
Func<IDestination, ExportInformation, Owned<ExportNotificationViewModel>> toastFactory)
|
Func<IDestination, ExportInformation, ISurface, Owned<ExportNotificationViewModel>> toastFactory)
|
||||||
{
|
{
|
||||||
_coreConfiguration = coreConfiguration;
|
_coreConfiguration = coreConfiguration;
|
||||||
_eventAggregator = eventAggregator;
|
_eventAggregator = eventAggregator;
|
||||||
|
@ -56,15 +56,16 @@ namespace Greenshot.Addons.Components
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="source">IDestination</param>
|
/// <param name="source">IDestination</param>
|
||||||
/// <param name="exportInformation">ExportInformation</param>
|
/// <param name="exportInformation">ExportInformation</param>
|
||||||
public void NotifyOfExport(IDestination source, ExportInformation exportInformation)
|
/// <param name="exportedSurface">ISurface</param>
|
||||||
|
public void NotifyOfExport(IDestination source, ExportInformation exportInformation, ISurface exportedSurface)
|
||||||
{
|
{
|
||||||
if (exportInformation == null || !_coreConfiguration.ShowTrayNotification || !exportInformation.ExportMade)
|
if (exportInformation == null || !_coreConfiguration.ShowTrayNotification)
|
||||||
{
|
{
|
||||||
Log.Info().WriteLine("No notification due to ShowTrayNotification = {0} - or export made = {1}", _coreConfiguration.ShowTrayNotification, exportInformation?.ExportMade);
|
Log.Info().WriteLine("No notification due to ShowTrayNotification = {0} - or export made = {1}", _coreConfiguration.ShowTrayNotification);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Create the ViewModel "part"
|
// Create the ViewModel "part"
|
||||||
var message = _toastFactory(source, exportInformation);
|
var message = _toastFactory(source, exportInformation, exportedSurface);
|
||||||
// Prepare to dispose the view model parts automatically if it's finished
|
// Prepare to dispose the view model parts automatically if it's finished
|
||||||
void DisposeHandler(object sender, DeactivationEventArgs args)
|
void DisposeHandler(object sender, DeactivationEventArgs args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,8 +31,6 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using Autofac.Features.OwnedInstances;
|
|
||||||
using Caliburn.Micro;
|
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Dapplo.Windows.Common.Extensions;
|
using Dapplo.Windows.Common.Extensions;
|
||||||
using Dapplo.Windows.Common.Structs;
|
using Dapplo.Windows.Common.Structs;
|
||||||
|
@ -42,7 +40,6 @@ using Dapplo.Windows.Extensions;
|
||||||
using Greenshot.Addons.Components;
|
using Greenshot.Addons.Components;
|
||||||
using Greenshot.Addons.Extensions;
|
using Greenshot.Addons.Extensions;
|
||||||
using Greenshot.Addons.Interfaces;
|
using Greenshot.Addons.Interfaces;
|
||||||
using Greenshot.Addons.ViewModels;
|
|
||||||
using Greenshot.Gfx;
|
using Greenshot.Gfx;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -54,9 +51,6 @@ namespace Greenshot.Addons.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class AbstractDestination : IDestination
|
public abstract class AbstractDestination : IDestination
|
||||||
{
|
{
|
||||||
private readonly ExportNotification _exportNotification;
|
|
||||||
private readonly IEventAggregator _eventAggregator;
|
|
||||||
private readonly Func<IDestination, Owned<ExportNotificationViewModel>> _toastFactory;
|
|
||||||
private static readonly LogSource Log = new LogSource();
|
private static readonly LogSource Log = new LogSource();
|
||||||
|
|
||||||
protected IGreenshotLanguage GreenshotLanguage { get; }
|
protected IGreenshotLanguage GreenshotLanguage { get; }
|
||||||
|
@ -64,10 +58,8 @@ namespace Greenshot.Addons.Core
|
||||||
|
|
||||||
protected AbstractDestination(
|
protected AbstractDestination(
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage)
|
||||||
ExportNotification exportNotification)
|
|
||||||
{
|
{
|
||||||
_exportNotification = exportNotification;
|
|
||||||
CoreConfiguration = coreConfiguration;
|
CoreConfiguration = coreConfiguration;
|
||||||
GreenshotLanguage = greenshotLanguage;
|
GreenshotLanguage = greenshotLanguage;
|
||||||
Designation = GetType().GetDesignation();
|
Designation = GetType().GetDesignation();
|
||||||
|
@ -241,39 +233,6 @@ namespace Greenshot.Addons.Core
|
||||||
//if (disposing) {}
|
//if (disposing) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A small helper method to perform some default destination actions, like inform the surface of the export
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="exportInformation"></param>
|
|
||||||
/// <param name="surface"></param>
|
|
||||||
public void ProcessExport(ExportInformation exportInformation, ISurface surface)
|
|
||||||
{
|
|
||||||
_exportNotification.NotifyOfExport(this, exportInformation);
|
|
||||||
if (exportInformation != null && exportInformation.ExportMade)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(exportInformation.Uri))
|
|
||||||
{
|
|
||||||
surface.UploadUrl = exportInformation.Uri;
|
|
||||||
surface.SendMessageEvent(this, SurfaceMessageTyp.UploadedUri, string.Format(GreenshotLanguage.ExportedTo, exportInformation.DestinationDescription));
|
|
||||||
}
|
|
||||||
else if (!string.IsNullOrEmpty(exportInformation.Filepath))
|
|
||||||
{
|
|
||||||
surface.LastSaveFullPath = exportInformation.Filepath;
|
|
||||||
surface.SendMessageEvent(this, SurfaceMessageTyp.FileSaved, string.Format(GreenshotLanguage.ExportedTo, exportInformation.DestinationDescription));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, string.Format(GreenshotLanguage.ExportedTo, exportInformation.DestinationDescription));
|
|
||||||
}
|
|
||||||
surface.Modified = false;
|
|
||||||
}
|
|
||||||
else if (!string.IsNullOrEmpty(exportInformation?.ErrorMessage))
|
|
||||||
{
|
|
||||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Error,
|
|
||||||
string.Format(GreenshotLanguage.ExportedTo, exportInformation.DestinationDescription) + " " + exportInformation.ErrorMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Description;
|
return Description;
|
||||||
|
|
|
@ -36,7 +36,13 @@ namespace Greenshot.Addons.Interfaces
|
||||||
ExportMade = exportMade;
|
ExportMade = exportMade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string DestinationDesignation { get; }
|
public bool IsError => !string.IsNullOrEmpty(ErrorMessage);
|
||||||
|
public bool IsOk => string.IsNullOrEmpty(ErrorMessage);
|
||||||
|
|
||||||
|
public bool IsFileExport => !string.IsNullOrEmpty(Filepath);
|
||||||
|
public bool IsCloudExport => !string.IsNullOrEmpty(Uri);
|
||||||
|
|
||||||
|
public string DestinationDesignation { get; }
|
||||||
|
|
||||||
public string DestinationDescription { get; set; }
|
public string DestinationDescription { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,14 @@
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Windows.Media;
|
||||||
using Dapplo.CaliburnMicro.Toasts.ViewModels;
|
using Dapplo.CaliburnMicro.Toasts.ViewModels;
|
||||||
|
using Dapplo.Log;
|
||||||
|
using Dapplo.Windows.Extensions;
|
||||||
using Greenshot.Addons.Components;
|
using Greenshot.Addons.Components;
|
||||||
|
using Greenshot.Addons.Core;
|
||||||
using Greenshot.Addons.Interfaces;
|
using Greenshot.Addons.Interfaces;
|
||||||
|
|
||||||
namespace Greenshot.Addons.ViewModels
|
namespace Greenshot.Addons.ViewModels
|
||||||
|
@ -30,13 +36,52 @@ namespace Greenshot.Addons.ViewModels
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class ExportNotificationViewModel : ToastBaseViewModel
|
public class ExportNotificationViewModel : ToastBaseViewModel
|
||||||
{
|
{
|
||||||
public ExportNotificationViewModel(IDestination source, ExportInformation exportInformation)
|
private static readonly LogSource Log = new LogSource();
|
||||||
|
public ExportNotificationViewModel(IDestination source, ExportInformation exportInformation, ISurface exportedSurface)
|
||||||
{
|
{
|
||||||
Information = exportInformation;
|
Information = exportInformation;
|
||||||
Source = source;
|
Source = source;
|
||||||
|
|
||||||
|
using (var bitmap = exportedSurface.GetBitmapForExport())
|
||||||
|
{
|
||||||
|
ExportBitmapSource = bitmap.ToBitmapSource();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImageSource GreenshotIcon => GreenshotResources.GreenshotIconAsBitmapSource();
|
||||||
|
|
||||||
|
public ImageSource ExportBitmapSource { get; }
|
||||||
|
|
||||||
public IDestination Source { get; }
|
public IDestination Source { get; }
|
||||||
|
|
||||||
public ExportInformation Information { get; }
|
public ExportInformation Information { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handle the click
|
||||||
|
/// </summary>
|
||||||
|
public void OpenExport()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Information.IsFileExport)
|
||||||
|
{
|
||||||
|
ExplorerHelper.OpenInExplorer(Information.Filepath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Information.IsCloudExport)
|
||||||
|
{
|
||||||
|
Process.Start(Information.Uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Error().WriteLine(ex,"While opening {0}", Information.Uri);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,31 @@
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:toastNotifications="clr-namespace:ToastNotifications.Core;assembly=ToastNotifications"
|
xmlns:toastNotifications="clr-namespace:ToastNotifications.Core;assembly=ToastNotifications"
|
||||||
xmlns:viewModels="clr-namespace:Greenshot.Addons.ViewModels"
|
xmlns:viewModels="clr-namespace:Greenshot.Addons.ViewModels"
|
||||||
mc:Ignorable="d" Background="{DynamicResource AccentColorBrush}" Width="200" Padding="5"
|
xmlns:cal="http://www.caliburnproject.org"
|
||||||
|
mc:Ignorable="d" Background="{DynamicResource AccentBaseColorBrush}" Width="300" Height="256" Padding="5"
|
||||||
d:DataContext="{d:DesignInstance viewModels:ExportNotificationViewModel,IsDesignTimeCreatable=False}"
|
d:DataContext="{d:DesignInstance viewModels:ExportNotificationViewModel,IsDesignTimeCreatable=False}"
|
||||||
d:DesignHeight="100" d:DesignWidth="200" HorizontalContentAlignment="Stretch" HorizontalAlignment="Right">
|
d:DesignHeight="100" d:DesignWidth="200" HorizontalContentAlignment="Stretch" HorizontalAlignment="Right">
|
||||||
<DockPanel LastChildFill="True">
|
<toastNotifications:NotificationDisplayPart.Resources>
|
||||||
<Image Source="{Binding Source.DisplayIconWpf}" Width="64" VerticalAlignment="Top"/>
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibility" />
|
||||||
<Label Content="{Binding Information.DestinationDescription}" VerticalAlignment="Center" FontWeight="Light" Foreground="White"/>
|
</toastNotifications:NotificationDisplayPart.Resources>
|
||||||
</DockPanel>
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="32" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="32" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="32" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- Top row -->
|
||||||
|
<Image Source="{Binding GreenshotIcon}" Stretch="Uniform" RenderOptions.BitmapScalingMode="Fant" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0"/>
|
||||||
|
<TextBlock Text="{Binding Information.DestinationDesignation}" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Light" Foreground="{DynamicResource IdealForegroundColorBrush}" TextWrapping="WrapWithOverflow" Grid.Row="0" Grid.Column="1" />
|
||||||
|
<Image Source="{Binding Source.DisplayIconWpf}" Stretch="Uniform" RenderOptions.BitmapScalingMode="Fant" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Row="0" Grid.Column="2"/>
|
||||||
|
|
||||||
|
<!-- Bottom row -->
|
||||||
|
<TextBlock Text="{Binding Information.ErrorMessage}" VerticalAlignment="Center" FontWeight="Bold" Visibility="{Binding Information.IsError, Converter={StaticResource BooleanToVisibility}}" Foreground="Red" TextWrapping="WrapWithOverflow" Grid.Row="1" Grid.Column="1" />
|
||||||
|
<Image cal:Message.Attach="[Event MouseDown] = [Action OpenExport()]" Source="{Binding ExportBitmapSource}" Visibility="{Binding Information.IsOk, Converter={StaticResource BooleanToVisibility}}" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Uniform" RenderOptions.BitmapScalingMode="Fant" UseLayoutRounding="True" Grid.Row="1" Grid.Column="1"/>
|
||||||
|
</Grid>
|
||||||
</toastNotifications:NotificationDisplayPart>
|
</toastNotifications:NotificationDisplayPart>
|
||||||
|
|
|
@ -45,12 +45,15 @@ namespace Greenshot.Destinations
|
||||||
[Destination("Clipboard", DestinationOrder.Clipboard)]
|
[Destination("Clipboard", DestinationOrder.Clipboard)]
|
||||||
public class ClipboardDestination : AbstractDestination
|
public class ClipboardDestination : AbstractDestination
|
||||||
{
|
{
|
||||||
|
private readonly ExportNotification _exportNotification;
|
||||||
|
|
||||||
public ClipboardDestination(
|
public ClipboardDestination(
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
|
_exportNotification = exportNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Description => GreenshotLanguage.SettingsDestinationClipboard;
|
public override string Description => GreenshotLanguage.SettingsDestinationClipboard;
|
||||||
|
@ -105,8 +108,8 @@ namespace Greenshot.Destinations
|
||||||
// TODO: Change to general logic in ProcessExport
|
// TODO: Change to general logic in ProcessExport
|
||||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Error, "Error"); //GreenshotLanguage.editorclipboardfailed);
|
surface.SendMessageEvent(this, SurfaceMessageTyp.Error, "Error"); //GreenshotLanguage.editorclipboardfailed);
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -42,7 +42,8 @@ namespace Greenshot.Destinations
|
||||||
[Destination("EMail", DestinationOrder.Email)]
|
[Destination("EMail", DestinationOrder.Email)]
|
||||||
public class EmailDestination : AbstractDestination
|
public class EmailDestination : AbstractDestination
|
||||||
{
|
{
|
||||||
private static readonly Bitmap MailIcon = GreenshotResources.GetBitmap("Email.Image");
|
private readonly ExportNotification _exportNotification;
|
||||||
|
private static readonly Bitmap MailIcon = GreenshotResources.GetBitmap("Email.Image");
|
||||||
private static bool _isActiveFlag;
|
private static bool _isActiveFlag;
|
||||||
private static string _mapiClient;
|
private static string _mapiClient;
|
||||||
|
|
||||||
|
@ -64,8 +65,9 @@ namespace Greenshot.Destinations
|
||||||
public EmailDestination(
|
public EmailDestination(
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
ExportNotification exportNotification) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
|
_exportNotification = exportNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Description
|
public override string Description
|
||||||
|
@ -112,8 +114,8 @@ namespace Greenshot.Destinations
|
||||||
var exportInformation = new ExportInformation(Designation, Description);
|
var exportInformation = new ExportInformation(Designation, Description);
|
||||||
MapiMailMessage.SendImage(surface, captureDetails);
|
MapiMailMessage.SendImage(surface, captureDetails);
|
||||||
exportInformation.ExportMade = true;
|
exportInformation.ExportMade = true;
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -45,13 +45,15 @@ namespace Greenshot.Destinations
|
||||||
[Destination("FileNoDialog", DestinationOrder.FileNoDialog)]
|
[Destination("FileNoDialog", DestinationOrder.FileNoDialog)]
|
||||||
public class FileDestination : AbstractDestination
|
public class FileDestination : AbstractDestination
|
||||||
{
|
{
|
||||||
private static readonly LogSource Log = new LogSource();
|
private readonly ExportNotification _exportNotification;
|
||||||
|
private static readonly LogSource Log = new LogSource();
|
||||||
|
|
||||||
public FileDestination(
|
public FileDestination(
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
ExportNotification exportNotification) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
|
_exportNotification = exportNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Description => GreenshotLanguage.QuicksettingsDestinationFile;
|
public override string Description => GreenshotLanguage.QuicksettingsDestinationFile;
|
||||||
|
@ -125,8 +127,8 @@ namespace Greenshot.Destinations
|
||||||
CoreConfiguration.OutputFileAsFullpath = fullPath;
|
CoreConfiguration.OutputFileAsFullpath = fullPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string CreateNewFilename(ICaptureDetails captureDetails)
|
private string CreateNewFilename(ICaptureDetails captureDetails)
|
||||||
|
|
|
@ -42,13 +42,15 @@ namespace Greenshot.Destinations
|
||||||
public class FileWithDialogDestination : AbstractDestination
|
public class FileWithDialogDestination : AbstractDestination
|
||||||
{
|
{
|
||||||
private readonly IGreenshotLanguage _greenshotLanguage;
|
private readonly IGreenshotLanguage _greenshotLanguage;
|
||||||
|
private readonly ExportNotification _exportNotification;
|
||||||
|
|
||||||
public FileWithDialogDestination(ICoreConfiguration coreConfiguration,
|
public FileWithDialogDestination(ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_greenshotLanguage = greenshotLanguage;
|
_greenshotLanguage = greenshotLanguage;
|
||||||
|
_exportNotification = exportNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Description => _greenshotLanguage.SettingsDestinationFileas;
|
public override string Description => _greenshotLanguage.SettingsDestinationFileas;
|
||||||
|
@ -69,8 +71,8 @@ namespace Greenshot.Destinations
|
||||||
captureDetails.Filename = savedTo;
|
captureDetails.Filename = savedTo;
|
||||||
CoreConfiguration.OutputFileAsFullpath = savedTo;
|
CoreConfiguration.OutputFileAsFullpath = savedTo;
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -49,7 +49,7 @@ namespace Greenshot.Destinations
|
||||||
ICoreConfiguration coreConfiguration,
|
ICoreConfiguration coreConfiguration,
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification
|
ExportNotification exportNotification
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_destinationHolder = destinationHolder;
|
_destinationHolder = destinationHolder;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,8 +54,8 @@ namespace Greenshot.Destinations
|
||||||
IGreenshotLanguage greenshotLanguage,
|
IGreenshotLanguage greenshotLanguage,
|
||||||
ExportNotification exportNotification,
|
ExportNotification exportNotification,
|
||||||
Func<ISurface, ICaptureDetails, Owned<PrintHelper>> printHelperFactory
|
Func<ISurface, ICaptureDetails, Owned<PrintHelper>> printHelperFactory
|
||||||
) : base(coreConfiguration, greenshotLanguage, exportNotification)
|
) : base(coreConfiguration, greenshotLanguage)
|
||||||
{
|
{
|
||||||
_greenshotLanguage = greenshotLanguage;
|
_greenshotLanguage = greenshotLanguage;
|
||||||
_exportNotification = exportNotification;
|
_exportNotification = exportNotification;
|
||||||
_printHelperFactory = printHelperFactory;
|
_printHelperFactory = printHelperFactory;
|
||||||
|
@ -161,8 +161,8 @@ namespace Greenshot.Destinations
|
||||||
exportInformation.ExportMade = true;
|
exportInformation.ExportMade = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessExport(exportInformation, surface);
|
_exportNotification.NotifyOfExport(this, exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -560,78 +560,7 @@ namespace Greenshot.Helpers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If a balloon tip is show for a taken capture, this handles the click on it
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void OpenCaptureOnClick(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (!(MainForm.Instance.NotifyIcon.Tag is SurfaceMessageEventArgs eventArgs))
|
|
||||||
{
|
|
||||||
Log.Warn().WriteLine("OpenCaptureOnClick called without SurfaceMessageEventArgs");
|
|
||||||
RemoveEventHandler(sender, e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var surface = eventArgs.Surface;
|
|
||||||
if (surface != null)
|
|
||||||
{
|
|
||||||
switch (eventArgs.MessageType)
|
|
||||||
{
|
|
||||||
case SurfaceMessageTyp.FileSaved:
|
|
||||||
ExplorerHelper.OpenInExplorer(surface.LastSaveFullPath);
|
|
||||||
break;
|
|
||||||
case SurfaceMessageTyp.UploadedUri:
|
|
||||||
Process.Start(surface.UploadUrl);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.Debug().WriteLine("Deregistering the BalloonTipClicked");
|
|
||||||
RemoveEventHandler(sender, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RemoveEventHandler(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
MainForm.Instance.NotifyIcon.BalloonTipClicked -= OpenCaptureOnClick;
|
|
||||||
MainForm.Instance.NotifyIcon.BalloonTipClosed -= RemoveEventHandler;
|
|
||||||
MainForm.Instance.NotifyIcon.Tag = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This is the SufraceMessageEvent receiver
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="eventArgs"></param>
|
|
||||||
private void SurfaceMessageReceived(object sender, SurfaceMessageEventArgs eventArgs)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(eventArgs?.Message))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (MainForm.Instance == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (eventArgs.MessageType)
|
|
||||||
{
|
|
||||||
case SurfaceMessageTyp.Error:
|
|
||||||
MainForm.Instance.NotifyIcon.ShowBalloonTip(10000, "Greenshot", eventArgs.Message, ToolTipIcon.Error);
|
|
||||||
break;
|
|
||||||
case SurfaceMessageTyp.Info:
|
|
||||||
MainForm.Instance.NotifyIcon.ShowBalloonTip(10000, "Greenshot", eventArgs.Message, ToolTipIcon.Info);
|
|
||||||
break;
|
|
||||||
case SurfaceMessageTyp.FileSaved:
|
|
||||||
case SurfaceMessageTyp.UploadedUri:
|
|
||||||
// Show a balloon and register an event handler to open the "capture" for if someone clicks the balloon.
|
|
||||||
MainForm.Instance.NotifyIcon.BalloonTipClicked += OpenCaptureOnClick;
|
|
||||||
MainForm.Instance.NotifyIcon.BalloonTipClosed += RemoveEventHandler;
|
|
||||||
// Store for later usage
|
|
||||||
MainForm.Instance.NotifyIcon.Tag = eventArgs;
|
|
||||||
MainForm.Instance.NotifyIcon.ShowBalloonTip(10000, "Greenshot", eventArgs.Message, ToolTipIcon.Info);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Process the actuall capture
|
/// Process the actuall capture
|
||||||
|
@ -680,11 +609,6 @@ namespace Greenshot.Helpers
|
||||||
surface.SetCapture(_capture);
|
surface.SetCapture(_capture);
|
||||||
surface.Modified = !outputMade;
|
surface.Modified = !outputMade;
|
||||||
|
|
||||||
// Register notify events if this is wanted
|
|
||||||
if (CoreConfig.ShowTrayNotification && !CoreConfig.HideTrayicon)
|
|
||||||
{
|
|
||||||
surface.SurfaceMessage += SurfaceMessageReceived;
|
|
||||||
}
|
|
||||||
// Let the processors do their job
|
// Let the processors do their job
|
||||||
foreach (var processor in _processors)
|
foreach (var processor in _processors)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,8 +50,7 @@ namespace Greenshot.Ui.Notifications.ViewModels
|
||||||
|
|
||||||
public string Message => string.Format(_greenshotLanguage.UpdateFound, LatestVersion);
|
public string Message => string.Format(_greenshotLanguage.UpdateFound, LatestVersion);
|
||||||
|
|
||||||
public ImageSource Icon => GreenshotResources.GreenshotIconAsBitmapSource();
|
public ImageSource GreenshotIcon => GreenshotResources.GreenshotIconAsBitmapSource();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle the click
|
/// Handle the click
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<ColumnDefinition Width="64" />
|
<ColumnDefinition Width="64" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image Source="{Binding Icon}" Width="64" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0"/>
|
<Image Source="{Binding GreenshotIcon}" Width="64" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0"/>
|
||||||
<TextBlock Text="{Binding Message}" VerticalAlignment="Center" FontWeight="Light" Foreground="{DynamicResource IdealForegroundColorBrush}" TextWrapping="WrapWithOverflow" Grid.Row="0" Grid.Column="1" />
|
<TextBlock Text="{Binding Message}" VerticalAlignment="Center" FontWeight="Light" Foreground="{DynamicResource IdealForegroundColorBrush}" TextWrapping="WrapWithOverflow" Grid.Row="0" Grid.Column="1" />
|
||||||
<Button Style="{DynamicResource SquareButtonStyle}" Focusable="False" cal:Message.Attach="[Action OpenDownloads()]" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
|
<Button Style="{DynamicResource SquareButtonStyle}" Focusable="False" cal:Message.Attach="[Action OpenDownloads()]" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
|
||||||
<TextBlock>
|
<TextBlock>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue