mirror of
https://github.com/greenshot/greenshot
synced 2025-08-22 22:34:27 -07:00
Updated dependencies, to solve some issues. Removed office destinations, depending on the availability.
This commit is contained in:
parent
40d9ec9060
commit
5921cb77da
47 changed files with 291 additions and 219 deletions
|
@ -58,7 +58,7 @@ namespace Greenshot.Addon.Box
|
|||
private static readonly LogSource Log = new LogSource();
|
||||
private readonly IBoxConfiguration _boxConfiguration;
|
||||
private readonly IBoxLanguage _boxLanguage;
|
||||
private readonly Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly INetworkConfiguration _networkConfiguration;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly OAuth2Settings _oauth2Settings;
|
||||
|
@ -70,7 +70,7 @@ namespace Greenshot.Addon.Box
|
|||
IGreenshotLanguage greenshotLanguage,
|
||||
IBoxConfiguration boxConfiguration,
|
||||
IBoxLanguage boxLanguage,
|
||||
Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IResourceProvider resourceProvider) : base(coreConfiguration, greenshotLanguage)
|
||||
{
|
||||
|
@ -136,9 +136,10 @@ namespace Greenshot.Addon.Box
|
|||
try
|
||||
{
|
||||
string url;
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory("Box", _boxLanguage.CommunicationWait, default))
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory(default))
|
||||
{
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
ownedPleaseWaitForm.Value.SetDetails("Box", _boxLanguage.CommunicationWait);
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
try
|
||||
{
|
||||
url = await UploadToBoxAsync(surfaceToUpload).ConfigureAwait(true);
|
||||
|
|
|
@ -70,14 +70,14 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -92,14 +92,14 @@
|
|||
<Reference Include="Dapplo.Confluence, Version=0.7.19.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Confluence.0.7.19\lib\net46\Dapplo.Confluence.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonSimple, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonSimple.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonSimple.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonSimple, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonSimple.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonSimple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.Confluence" version="0.7.19" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonSimple" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonSimple" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -54,7 +54,7 @@ using Newtonsoft.Json;
|
|||
namespace Greenshot.Addon.Dropbox
|
||||
{
|
||||
[Destination("Dropbox")]
|
||||
public class DropboxDestination : AbstractDestination
|
||||
public sealed class DropboxDestination : AbstractDestination
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private static readonly Uri DropboxApiUri = new Uri("https://api.dropbox.com");
|
||||
|
@ -63,7 +63,7 @@ namespace Greenshot.Addon.Dropbox
|
|||
private readonly IDropboxConfiguration _dropboxPluginConfiguration;
|
||||
private readonly IDropboxLanguage _dropboxLanguage;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private OAuth2Settings _oAuth2Settings;
|
||||
private IHttpBehaviour _oAuthHttpBehaviour;
|
||||
|
||||
|
@ -74,7 +74,7 @@ namespace Greenshot.Addon.Dropbox
|
|||
IResourceProvider resourceProvider,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||
) : base(coreConfiguration, greenshotLanguage)
|
||||
{
|
||||
_dropboxPluginConfiguration = dropboxPluginConfiguration;
|
||||
|
@ -152,9 +152,10 @@ namespace Greenshot.Addon.Dropbox
|
|||
try
|
||||
{
|
||||
var cancellationTokenSource = new CancellationTokenSource();
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory("Dropbox", _dropboxLanguage.CommunicationWait, cancellationTokenSource))
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory(cancellationTokenSource))
|
||||
{
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
ownedPleaseWaitForm.Value.SetDetails("Dropbox", _dropboxLanguage.CommunicationWait);
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
try
|
||||
{
|
||||
var filename = surfaceToUpload.GenerateFilename(CoreConfiguration, _dropboxPluginConfiguration);
|
||||
|
|
|
@ -82,14 +82,14 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace Greenshot.Addon.ExternalCommand
|
|||
/// <summary>
|
||||
/// ExternalCommandDestination provides a destination to export to an external command
|
||||
/// </summary>
|
||||
public class ExternalCommandDestination : AbstractDestination
|
||||
public sealed class ExternalCommandDestination : AbstractDestination
|
||||
{
|
||||
private static readonly Regex UriRegexp = new Regex(
|
||||
@"((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)", RegexOptions.Compiled);
|
||||
|
@ -60,24 +60,24 @@ namespace Greenshot.Addon.ExternalCommand
|
|||
_externalCommandConfiguration = externalCommandConfiguration;
|
||||
}
|
||||
|
||||
public override string Designation => "External " + _externalCommandDefinition.Name.Replace(',', '_');
|
||||
/// <inheritdoc />
|
||||
public override string Designation => "External " + _externalCommandDefinition.Name.Replace(',', '_');
|
||||
|
||||
public override string Description => _externalCommandDefinition.Name;
|
||||
/// <inheritdoc />
|
||||
public override string Description => _externalCommandDefinition.Name;
|
||||
|
||||
public override Bitmap GetDisplayIcon(double dpi)
|
||||
/// <inheritdoc />
|
||||
public override Bitmap GetDisplayIcon(double dpi)
|
||||
{
|
||||
return IconCache.IconForCommand(_externalCommandDefinition, dpi > 100);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async Task<ExportInformation> ExportCaptureAsync(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails)
|
||||
{
|
||||
var exportInformation = new ExportInformation(Designation, Description);
|
||||
|
||||
var fullPath = captureDetails.Filename;
|
||||
if (fullPath == null)
|
||||
{
|
||||
fullPath = surface.SaveNamedTmpFile(CoreConfiguration, _externalCommandConfiguration);
|
||||
}
|
||||
var fullPath = captureDetails.Filename ?? surface.SaveNamedTmpFile(CoreConfiguration, _externalCommandConfiguration);
|
||||
|
||||
using (var cli = new Cli(_externalCommandDefinition.Command))
|
||||
{
|
||||
|
@ -106,7 +106,6 @@ namespace Greenshot.Addon.ExternalCommand
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
ProcessExport(exportInformation, surface);
|
||||
return exportInformation;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,8 @@ namespace Greenshot.Addon.ExternalCommand
|
|||
_greenshotLanguage = greenshotLanguage;
|
||||
}
|
||||
|
||||
public IEnumerable<Lazy<IDestination, DestinationAttribute>> Provide()
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<Lazy<IDestination, DestinationAttribute>> Provide()
|
||||
{
|
||||
return _externalCommandConfig.Commands
|
||||
.Select(command => _externalCommandConfig.Read(command))
|
||||
|
@ -90,7 +91,7 @@ namespace Greenshot.Addon.ExternalCommand
|
|||
return false;
|
||||
}
|
||||
var commandline = FilenameHelper.FillVariables(_externalCommandConfig.Commandline[command], true);
|
||||
commandline = FilenameHelper.FillCmdVariables(commandline, true);
|
||||
commandline = FilenameHelper.FillCmdVariables(commandline);
|
||||
|
||||
if (File.Exists(commandline))
|
||||
{
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Greenshot.Addon.ExternalCommand.Views"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:viewModels="clr-namespace:Greenshot.Addon.ExternalCommand.ViewModels"
|
||||
d:DataContext="{d:DesignInstance viewModels:ExternalCommandDetailsViewModel,IsDesignTimeCreatable=False}"
|
||||
mc:Ignorable="d">
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:viewModels="clr-namespace:Greenshot.Addon.ExternalCommand.ViewModels"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance viewModels:ExternalCommandMasterViewModel,IsDesignTimeCreatable=False}"
|
||||
|
|
|
@ -58,14 +58,14 @@ namespace Greenshot.Addon.Flickr
|
|||
/// This defines the flickr destination
|
||||
/// </summary>
|
||||
[Destination("Flickr")]
|
||||
public class FlickrDestination : AbstractDestination
|
||||
public sealed class FlickrDestination : AbstractDestination
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private static readonly Uri FlickrOAuthUri = new Uri("https://api.flickr.com/services/oauth");
|
||||
private readonly IFlickrConfiguration _flickrConfiguration;
|
||||
private readonly IFlickrLanguage _flickrLanguage;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly OAuth1Settings _oAuthSettings;
|
||||
private readonly OAuth1HttpBehaviour _oAuthHttpBehaviour;
|
||||
private const string FlickrFarmUrl = "https://farm{0}.staticflickr.com/{1}/{2}_{3}.jpg";
|
||||
|
@ -87,7 +87,7 @@ namespace Greenshot.Addon.Flickr
|
|||
IResourceProvider resourceProvider,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||
) : base(coreConfiguration, greenshotLanguage)
|
||||
{
|
||||
_flickrConfiguration = flickrConfiguration;
|
||||
|
@ -159,9 +159,10 @@ namespace Greenshot.Addon.Flickr
|
|||
{
|
||||
|
||||
var cancellationTokenSource = new CancellationTokenSource();
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory("Flickr", _flickrLanguage.CommunicationWait, cancellationTokenSource))
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory(cancellationTokenSource))
|
||||
{
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
ownedPleaseWaitForm.Value.SetDetails("Flickr", _flickrLanguage.CommunicationWait);
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
try
|
||||
{
|
||||
uploadUrl = await UploadToFlickrAsync(surface, captureDetails.Title, cancellationTokenSource.Token);
|
||||
|
@ -201,7 +202,6 @@ namespace Greenshot.Addon.Flickr
|
|||
/// </summary>
|
||||
/// <param name="surfaceToUpload"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="progress">IProgres is used to report the progress to</param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns>url to image</returns>
|
||||
public async Task<string> UploadToFlickrAsync(ISurface surfaceToUpload, string title, CancellationToken token = default)
|
||||
|
@ -240,9 +240,9 @@ namespace Greenshot.Addon.Flickr
|
|||
Properties = signedParameters
|
||||
});
|
||||
var response = await FlickrUploadUri.PostAsync<XDocument>(streamContent, token).ConfigureAwait(false);
|
||||
photoId = (from element in response.Root.Elements()
|
||||
photoId = (from element in response?.Root?.Elements() ?? Enumerable.Empty<XElement>()
|
||||
where element.Name == "photoid"
|
||||
select element.Value).First();
|
||||
select element.Value).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,11 +82,11 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -52,14 +52,14 @@ using Greenshot.Gfx;
|
|||
namespace Greenshot.Addon.GooglePhotos
|
||||
{
|
||||
[Destination("GooglePhotos")]
|
||||
public class GooglePhotosDestination : AbstractDestination
|
||||
public sealed class GooglePhotosDestination : AbstractDestination
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private readonly IGooglePhotosConfiguration _googlePhotosConfiguration;
|
||||
private readonly IGooglePhotosLanguage _googlePhotosLanguage;
|
||||
private readonly INetworkConfiguration _networkConfiguration;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly OAuth2Settings _oAuth2Settings;
|
||||
|
||||
public GooglePhotosDestination(
|
||||
|
@ -69,7 +69,7 @@ namespace Greenshot.Addon.GooglePhotos
|
|||
IResourceProvider resourceProvider,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||
) : base(coreConfiguration, greenshotLanguage)
|
||||
{
|
||||
_googlePhotosConfiguration = googlePhotosConfiguration;
|
||||
|
@ -116,7 +116,7 @@ namespace Greenshot.Addon.GooglePhotos
|
|||
public override async Task<ExportInformation> ExportCaptureAsync(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails)
|
||||
{
|
||||
var exportInformation = new ExportInformation(Designation, Description);
|
||||
var uploadUrl = await Upload(captureDetails, surface).ConfigureAwait(true);
|
||||
var uploadUrl = await Upload(surface).ConfigureAwait(true);
|
||||
if (uploadUrl != null)
|
||||
{
|
||||
exportInformation.ExportMade = true;
|
||||
|
@ -126,17 +126,18 @@ namespace Greenshot.Addon.GooglePhotos
|
|||
return exportInformation;
|
||||
}
|
||||
|
||||
private async Task<string> Upload(ICaptureDetails captureDetails, ISurface surfaceToUpload)
|
||||
private async Task<string> Upload(ISurface surfaceToUpload)
|
||||
{
|
||||
try
|
||||
{
|
||||
string url;
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory("GooglePhotos", _googlePhotosLanguage.CommunicationWait, default))
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory(default))
|
||||
{
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
ownedPleaseWaitForm.Value.SetDetails("GooglePhotos", _googlePhotosLanguage.CommunicationWait);
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
try
|
||||
{
|
||||
url = await UploadToPicasa(surfaceToUpload).ConfigureAwait(true);
|
||||
url = await UploadToGooglePhotos(surfaceToUpload).ConfigureAwait(true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -169,7 +170,7 @@ namespace Greenshot.Addon.GooglePhotos
|
|||
/// <param name="progress"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<string> UploadToPicasa(ISurface surface, IProgress<int> progress = null, CancellationToken token = default)
|
||||
private async Task<string> UploadToGooglePhotos(ISurface surface, IProgress<int> progress = null, CancellationToken token = default)
|
||||
{
|
||||
string filename = surface.GenerateFilename(CoreConfiguration, _googlePhotosConfiguration);
|
||||
|
||||
|
@ -178,7 +179,7 @@ namespace Greenshot.Addon.GooglePhotos
|
|||
// Use UploadProgress
|
||||
if (progress != null)
|
||||
{
|
||||
oAuthHttpBehaviour.UploadProgress = percent => { UiContext.RunOn(() => progress.Report((int)(percent * 100))); };
|
||||
oAuthHttpBehaviour.UploadProgress = percent => { UiContext.RunOn(() => progress.Report((int)(percent * 100)), token); };
|
||||
}
|
||||
oAuthHttpBehaviour.OnHttpMessageHandlerCreated = httpMessageHandler => new OAuth2HttpMessageHandler(_oAuth2Settings, oAuthHttpBehaviour, httpMessageHandler);
|
||||
if (_googlePhotosConfiguration.AddFilename)
|
||||
|
|
|
@ -68,11 +68,11 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -87,14 +87,14 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace Greenshot.Addon.Imgur
|
|||
private readonly IImgurLanguage _imgurLanguage;
|
||||
private readonly ImgurApi _imgurApi;
|
||||
private readonly ImgurHistoryViewModel _imgurHistoryViewModel;
|
||||
private readonly Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
|
||||
public ImgurDestination(
|
||||
|
@ -68,7 +68,7 @@ namespace Greenshot.Addon.Imgur
|
|||
IImgurLanguage imgurLanguage,
|
||||
ImgurApi imgurApi,
|
||||
ImgurHistoryViewModel imgurHistoryViewModel,
|
||||
Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
IResourceProvider resourceProvider) : base(coreConfiguration, greenshotLanguage)
|
||||
{
|
||||
_imgurConfiguration = imgurConfiguration;
|
||||
|
@ -120,8 +120,9 @@ namespace Greenshot.Addon.Imgur
|
|||
|
||||
var cancellationTokenSource = new CancellationTokenSource();
|
||||
// TODO: Replace the form
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory("Imgur", _imgurLanguage.CommunicationWait, cancellationTokenSource))
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory(cancellationTokenSource))
|
||||
{
|
||||
ownedPleaseWaitForm.Value.SetDetails("Imgur", _imgurLanguage.CommunicationWait);
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
try
|
||||
{
|
||||
|
|
|
@ -38,6 +38,9 @@ using Greenshot.Addons.Extensions;
|
|||
|
||||
namespace Greenshot.Addon.Imgur.ViewModels
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the view model for the history
|
||||
/// </summary>
|
||||
public sealed class ImgurHistoryViewModel : Screen
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
|
@ -53,6 +56,9 @@ namespace Greenshot.Addon.Imgur.ViewModels
|
|||
|
||||
public IImgurLanguage ImgurLanguage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Used from the View
|
||||
/// </summary>
|
||||
public IGreenshotLanguage GreenshotLanguage { get; }
|
||||
|
||||
public ImgurHistoryViewModel(
|
||||
|
@ -81,7 +87,7 @@ namespace Greenshot.Addon.Imgur.ViewModels
|
|||
{
|
||||
ImgurLanguage.CreateDisplayNameBinding(this, nameof(IImgurLanguage.History))
|
||||
};
|
||||
LoadHistory();
|
||||
var ignoringTask = LoadHistory();
|
||||
}
|
||||
|
||||
protected override void OnDeactivate(bool close)
|
||||
|
@ -96,7 +102,7 @@ namespace Greenshot.Addon.Imgur.ViewModels
|
|||
private async Task LoadHistory(CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Load the ImUr history
|
||||
foreach (string hash in ImgurConfiguration.ImgurUploadHistory.Keys)
|
||||
foreach (var hash in ImgurConfiguration.ImgurUploadHistory.Keys)
|
||||
{
|
||||
if (ImgurHistory.Any(imgurInfo => imgurInfo.Data.Id == hash))
|
||||
{
|
||||
|
@ -133,15 +139,27 @@ namespace Greenshot.Addon.Imgur.ViewModels
|
|||
|
||||
public ImgurImage SelectedImgur { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used from the View
|
||||
/// </summary>
|
||||
public bool CanDelete => true;
|
||||
|
||||
/// <summary>
|
||||
/// Used from the View
|
||||
/// </summary>
|
||||
public async Task Delete()
|
||||
{
|
||||
await ImgurApi.DeleteImgurImageAsync(SelectedImgur).ConfigureAwait(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used from the View
|
||||
/// </summary>
|
||||
public bool CanCopyToClipboard => true;
|
||||
|
||||
/// <summary>
|
||||
/// Used from the View
|
||||
/// </summary>
|
||||
public void CopyToClipboard()
|
||||
{
|
||||
using (var clipboardAccessToken = ClipboardNative.Access())
|
||||
|
@ -151,6 +169,9 @@ namespace Greenshot.Addon.Imgur.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used from the View
|
||||
/// </summary>
|
||||
public void ClearHistory()
|
||||
{
|
||||
ImgurConfiguration.RuntimeImgurHistory.Clear();
|
||||
|
@ -158,6 +179,9 @@ namespace Greenshot.Addon.Imgur.ViewModels
|
|||
ImgurHistory.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used from the View
|
||||
/// </summary>
|
||||
public void Show()
|
||||
{
|
||||
var link = SelectedImgur.Data.Link?.AbsoluteUri;
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -87,14 +87,14 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Jira" version="0.7.10" targetFramework="net46" />
|
||||
|
|
|
@ -67,8 +67,8 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -85,11 +85,11 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace Greenshot.Addon.Lutim {
|
|||
private readonly ILutimLanguage _lutimLanguage;
|
||||
private readonly LutimApi _lutimApi;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
|
||||
public LutimDestination(ILutimConfiguration lutimConfiguration,
|
||||
ILutimLanguage lutimLanguage,
|
||||
|
@ -57,7 +57,7 @@ namespace Greenshot.Addon.Lutim {
|
|||
IResourceProvider resourceProvider,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory
|
||||
) : base(coreConfiguration, greenshotLanguage)
|
||||
{
|
||||
_lutimConfiguration = lutimConfiguration;
|
||||
|
@ -106,8 +106,9 @@ namespace Greenshot.Addon.Lutim {
|
|||
LutimInfo lutimInfo;
|
||||
|
||||
var cancellationTokenSource = new CancellationTokenSource();
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory("Lutim", _lutimLanguage.CommunicationWait, cancellationTokenSource))
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory(cancellationTokenSource))
|
||||
{
|
||||
ownedPleaseWaitForm.Value.SetDetails("Lutim", _lutimLanguage.CommunicationWait);
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
try
|
||||
{
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -27,6 +27,7 @@ using Dapplo.CaliburnMicro.Configuration;
|
|||
using Greenshot.Addon.Office.Destinations;
|
||||
using Greenshot.Addon.Office.ViewModels;
|
||||
using Greenshot.Addons.Components;
|
||||
using Greenshot.Addons.Core;
|
||||
|
||||
namespace Greenshot.Addon.Office
|
||||
{
|
||||
|
@ -35,34 +36,60 @@ namespace Greenshot.Addon.Office
|
|||
{
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
builder
|
||||
.RegisterType<ExcelDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
var hasDestination = false;
|
||||
|
||||
builder
|
||||
.RegisterType<WordDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
if (PluginUtils.GetExePath("EXCEL.EXE") != null)
|
||||
{
|
||||
hasDestination = true;
|
||||
builder
|
||||
.RegisterType<ExcelDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
}
|
||||
|
||||
builder
|
||||
.RegisterType<PowerpointDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
if (PluginUtils.GetExePath("WINWORD.EXE") != null)
|
||||
{
|
||||
hasDestination = true;
|
||||
builder
|
||||
.RegisterType<WordDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
}
|
||||
|
||||
builder
|
||||
.RegisterType<OneNoteDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
if (PluginUtils.GetExePath("POWERPNT.EXE") != null)
|
||||
{
|
||||
hasDestination = true;
|
||||
builder
|
||||
.RegisterType<PowerpointDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
}
|
||||
|
||||
builder
|
||||
.RegisterType<OutlookDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
builder
|
||||
.RegisterType<OfficeConfigViewModel>()
|
||||
.As<IConfigScreen>()
|
||||
.SingleInstance();
|
||||
if (PluginUtils.GetExePath("ONENOTE.EXE") != null)
|
||||
{
|
||||
hasDestination = true;
|
||||
builder
|
||||
.RegisterType<OneNoteDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
}
|
||||
|
||||
if (PluginUtils.GetExePath("OUTLOOK.EXE") != null)
|
||||
{
|
||||
hasDestination = true;
|
||||
builder
|
||||
.RegisterType<OutlookDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
}
|
||||
|
||||
if (hasDestination)
|
||||
{
|
||||
builder
|
||||
.RegisterType<OfficeConfigViewModel>()
|
||||
.As<IConfigScreen>()
|
||||
.SingleInstance();
|
||||
}
|
||||
|
||||
base.Load(builder);
|
||||
}
|
||||
|
|
|
@ -81,14 +81,14 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace Greenshot.Addon.OneDrive
|
|||
private readonly IOneDriveConfiguration _oneDriveConfiguration;
|
||||
private readonly IOneDriveLanguage _oneDriveLanguage;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly OAuth2Settings _oauth2Settings;
|
||||
private static readonly Uri GraphUri = new Uri("https://graph.microsoft.com");
|
||||
private static readonly Uri OneDriveUri = GraphUri.AppendSegments("v1.0", "me", "drive");
|
||||
|
@ -75,7 +75,7 @@ namespace Greenshot.Addon.OneDrive
|
|||
IOneDriveLanguage oneDriveLanguage,
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IResourceProvider resourceProvider,
|
||||
Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage
|
||||
) : base(coreConfiguration, greenshotLanguage)
|
||||
|
@ -152,8 +152,9 @@ namespace Greenshot.Addon.OneDrive
|
|||
Uri response;
|
||||
|
||||
var cancellationTokenSource = new CancellationTokenSource();
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory("OneDrive", _oneDriveLanguage.CommunicationWait, cancellationTokenSource))
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory(cancellationTokenSource))
|
||||
{
|
||||
ownedPleaseWaitForm.Value.SetDetails("OneDrive", _oneDriveLanguage.CommunicationWait);
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
try
|
||||
{
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -82,11 +82,11 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -81,11 +81,11 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -56,16 +56,20 @@ namespace Greenshot.Addon.Tfs
|
|||
_coreConfiguration = coreConfiguration;
|
||||
_tfsConfiguration = tfsConfiguration;
|
||||
|
||||
#if DEBUG
|
||||
// Set json log threshold high
|
||||
DefaultJsonHttpContentConverter.Instance.Value.LogThreshold = 0;
|
||||
#endif
|
||||
_tfsHttpBehaviour = new HttpBehaviour
|
||||
{
|
||||
HttpSettings = networkConfiguration,
|
||||
JsonSerializer = new JsonNetJsonSerializer()
|
||||
};
|
||||
|
||||
#if DEBUG
|
||||
// Set json log threshold high
|
||||
_tfsHttpBehaviour.RequestConfigurations[nameof(DefaultJsonHttpContentConverterConfiguration)] = new DefaultJsonHttpContentConverterConfiguration
|
||||
{
|
||||
LogThreshold = 0
|
||||
};
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
public bool CanUpdate => _tfsConfiguration.TfsUri != null && !string.IsNullOrEmpty(_tfsConfiguration.ApiKey);
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace Greenshot.Addon.Tfs
|
|||
private readonly ITfsConfiguration _tfsConfiguration;
|
||||
private readonly ITfsLanguage _tfsLanguage;
|
||||
private readonly TfsClient _tfsClient;
|
||||
private readonly Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly WorkItem _workItem;
|
||||
|
||||
|
@ -66,7 +66,7 @@ namespace Greenshot.Addon.Tfs
|
|||
ITfsConfiguration tfsConfiguration,
|
||||
ITfsLanguage tfsLanguage,
|
||||
TfsClient tfsClient,
|
||||
Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
IResourceProvider resourceProvider) : base(coreConfiguration, greenshotLanguage)
|
||||
{
|
||||
_tfsConfiguration = tfsConfiguration;
|
||||
|
@ -82,7 +82,7 @@ namespace Greenshot.Addon.Tfs
|
|||
ITfsConfiguration tfsConfiguration,
|
||||
ITfsLanguage tfsLanguage,
|
||||
TfsClient tfsClient,
|
||||
Func<string, string, CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
IResourceProvider resourceProvider,
|
||||
WorkItem workItem) :this(coreConfiguration, greenshotLanguage, tfsConfiguration, tfsLanguage, tfsClient, pleaseWaitFormFactory, resourceProvider)
|
||||
{
|
||||
|
@ -178,8 +178,9 @@ namespace Greenshot.Addon.Tfs
|
|||
Uri response;
|
||||
|
||||
var cancellationTokenSource = new CancellationTokenSource();
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory("TFS plug-in", _tfsLanguage.CommunicationWait, cancellationTokenSource))
|
||||
using (var ownedPleaseWaitForm = _pleaseWaitFormFactory(cancellationTokenSource))
|
||||
{
|
||||
ownedPleaseWaitForm.Value.SetDetails("TFS plug-in", _tfsLanguage.CommunicationWait);
|
||||
ownedPleaseWaitForm.Value.Show();
|
||||
try
|
||||
{
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -44,10 +44,9 @@ namespace Greenshot.Addons.Controls
|
|||
/// <summary>
|
||||
/// Prevent the close-window button showing
|
||||
/// </summary>
|
||||
private const int CP_NOCLOSE_BUTTON = 0x200;
|
||||
private const int CpNocloseButton = 0x200;
|
||||
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private string _title;
|
||||
private readonly CancellationTokenSource _cancellationTokenSource;
|
||||
private Thread _waitFor;
|
||||
|
||||
|
@ -61,15 +60,9 @@ namespace Greenshot.Addons.Controls
|
|||
Icon = GreenshotResources.GetGreenshotIcon();
|
||||
}
|
||||
|
||||
public PleaseWaitForm(IGreenshotLanguage greenshotLanguage,
|
||||
string title,
|
||||
string text,
|
||||
CancellationTokenSource cancellationTokenSource = default) : this(greenshotLanguage)
|
||||
public PleaseWaitForm(IGreenshotLanguage greenshotLanguage, CancellationTokenSource cancellationTokenSource = default) : this(greenshotLanguage)
|
||||
{
|
||||
_title = title;
|
||||
_cancellationTokenSource = cancellationTokenSource;
|
||||
Text = title;
|
||||
label_pleasewait.Text = text;
|
||||
}
|
||||
|
||||
protected override CreateParams CreateParams
|
||||
|
@ -77,11 +70,24 @@ namespace Greenshot.Addons.Controls
|
|||
get
|
||||
{
|
||||
var createParams = base.CreateParams;
|
||||
createParams.ClassStyle = createParams.ClassStyle | CP_NOCLOSE_BUTTON;
|
||||
createParams.ClassStyle = createParams.ClassStyle | CpNocloseButton;
|
||||
return createParams;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the details
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <returns></returns>
|
||||
public PleaseWaitForm SetDetails(string title, string text)
|
||||
{
|
||||
Text = title;
|
||||
label_pleasewait.Text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show the "please wait" form, execute the code from the delegate and wait until execution finishes.
|
||||
/// The supplied delegate will be wrapped with a try/catch so this method can return any exception that was thrown.
|
||||
|
@ -90,10 +96,8 @@ namespace Greenshot.Addons.Controls
|
|||
/// <param name="text">The text in the form</param>
|
||||
/// <param name="executeTask">Task</param>
|
||||
public async Task ShowAndWait(string title, string text, Task executeTask)
|
||||
{
|
||||
_title = title;
|
||||
Text = title;
|
||||
label_pleasewait.Text = text;
|
||||
{
|
||||
SetDetails(title, text);
|
||||
cancelButton.Text = _greenshotLanguage.Cancel;
|
||||
|
||||
Show();
|
||||
|
@ -110,10 +114,8 @@ namespace Greenshot.Addons.Controls
|
|||
/// <param name="waitDelegate">delegate { with your code }</param>
|
||||
public void ShowAndWait(string title, string text, ThreadStart waitDelegate)
|
||||
{
|
||||
_title = title;
|
||||
Text = title;
|
||||
label_pleasewait.Text = text;
|
||||
cancelButton.Text = _greenshotLanguage.Cancel;
|
||||
SetDetails(title, text);
|
||||
cancelButton.Text = _greenshotLanguage.Cancel;
|
||||
|
||||
// Make sure the form is shown.
|
||||
Show();
|
||||
|
@ -174,11 +176,10 @@ namespace Greenshot.Addons.Controls
|
|||
/// <param name="e"></param>
|
||||
private void CancelButtonClick(object sender, EventArgs e)
|
||||
{
|
||||
Log.Debug().WriteLine("Cancel clicked on {0}", _title);
|
||||
Log.Debug().WriteLine("Cancel clicked on {0}", Text);
|
||||
cancelButton.Enabled = false;
|
||||
_waitFor?.Abort();
|
||||
_cancellationTokenSource?.Cancel();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -47,13 +47,23 @@ namespace Greenshot.Addons.Core
|
|||
{
|
||||
private const string PathKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\";
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get<ICoreConfiguration>();
|
||||
private static bool _isHooked = false;
|
||||
private static readonly IDictionary<string, Bitmap> ExeIconCache = new Dictionary<string, Bitmap>();
|
||||
|
||||
static PluginUtils()
|
||||
{
|
||||
CoreConfig.PropertyChanged += OnIconSizeChanged;
|
||||
}
|
||||
/// <summary>
|
||||
/// TODO: Replace this, as soon as we have fixed the configuration, this should not be done via a static class...
|
||||
/// </summary>
|
||||
private static void SetupIconResizing()
|
||||
{
|
||||
if (!_isHooked)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_isHooked = true;
|
||||
var coreConfiguration = IniConfig.Current.Get<ICoreConfiguration>();
|
||||
coreConfiguration.PropertyChanged += OnIconSizeChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear icon cache
|
||||
|
@ -130,7 +140,9 @@ namespace Greenshot.Addons.Core
|
|||
Bitmap returnValue;
|
||||
lock (ExeIconCache)
|
||||
{
|
||||
if (ExeIconCache.TryGetValue(cacheKey, out returnValue))
|
||||
SetupIconResizing();
|
||||
|
||||
if (ExeIconCache.TryGetValue(cacheKey, out returnValue))
|
||||
{
|
||||
return returnValue;
|
||||
}
|
||||
|
|
|
@ -65,14 +65,14 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
<package id="Dapplo.CaliburnMicro.Menu" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -83,8 +83,8 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<package id="Dapplo.Addons.Bootstrapper" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
|
@ -88,14 +88,14 @@
|
|||
<Reference Include="Dapplo.CaliburnMicro.Translations, Version=1.0.47.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.CaliburnMicro.Translations.1.0.47\lib\net46\Dapplo.CaliburnMicro.Translations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.35\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.8.38\lib\net46\Dapplo.HttpExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.35\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.JsonNet, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.JsonNet.0.8.38\lib\net46\Dapplo.HttpExtensions.JsonNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.35.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.35\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
<Reference Include="Dapplo.HttpExtensions.OAuth, Version=0.8.38.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.HttpExtensions.OAuth.0.8.38\lib\net46\Dapplo.HttpExtensions.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Dapplo.Ini, Version=0.5.28.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Dapplo.Ini.0.5.28\lib\net45\Dapplo.Ini.dll</HintPath>
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
<package id="Dapplo.CaliburnMicro.Metro" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Security" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.CaliburnMicro.Translations" version="1.0.47" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.35" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.JsonNet" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.HttpExtensions.OAuth" version="0.8.38" targetFramework="net46" />
|
||||
<package id="Dapplo.Ini" version="0.5.28" targetFramework="net46" />
|
||||
<package id="Dapplo.InterfaceImpl" version="0.2.12" targetFramework="net46" />
|
||||
<package id="Dapplo.Language" version="0.5.28" targetFramework="net46" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue