Made the other projects, except Dapplo.Addons.Win10, available and they compile. The Addons are not tested yet.

This commit is contained in:
Robin 2018-11-08 15:12:42 +01:00
commit d72ee8c943
141 changed files with 2164 additions and 2453 deletions

View file

@ -24,8 +24,7 @@
#region Usings
using System.ComponentModel;
using Dapplo.Ini;
using Dapplo.InterfaceImpl.Extensions;
using Dapplo.Config.Ini;
using Greenshot.Core.Enums;
#endregion
@ -37,7 +36,7 @@ namespace Greenshot.Addon.Confluence
/// </summary>
[IniSection("Confluence")]
[Description("Greenshot Confluence Plugin configuration")]
public interface IConfluenceConfiguration : IIniSection, ITransactionalProperties, INotifyPropertyChanged
public interface IConfluenceConfiguration : IIniSection
{
[Description("Url to Confluence system, including wsdl.")]
[DefaultValue("https://confluence")]

View file

@ -22,12 +22,12 @@
#endregion
using System.ComponentModel;
using Dapplo.Language;
using Dapplo.Config.Language;
namespace Greenshot.Addon.Confluence
{
[Language("Confluence")]
public interface IConfluenceLanguage : ILanguage, INotifyPropertyChanged
public interface IConfluenceLanguage : ILanguage
{
string PluginSettings { get; }
string LoginError { get; }

View file

@ -0,0 +1,46 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Ini;
using Greenshot.Core.Enums;
namespace Greenshot.Addon.Confluence.Configuration.Impl
{
public class ConfluenceConfigurationImpl : IniSectionBase<IConfluenceConfiguration>, IConfluenceConfiguration
{
#region Implementation of IConfluenceConfiguration
public string Url { get; set; }
public int Timeout { get; set; }
public OutputFormats UploadFormat { get; set; }
public int UploadJpegQuality { get; set; }
public bool UploadReduceColors { get; set; }
public string OutputFileFilenamePattern { get; set; }
public bool OpenPageAfterUpload { get; set; }
public bool CopyWikiMarkupForImageToClipboard { get; set; }
public string SearchSpaceKey { get; set; }
public bool IncludePersonSpaces { get; set; }
#endregion
}
}

View file

@ -0,0 +1,58 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Language;
namespace Greenshot.Addon.Confluence.Configuration.Impl
{
public class ConfluenceLanguageImpl : LanguageBase<IConfluenceLanguage>, IConfluenceLanguage
{
#region Implementation of IConfluenceLanguage
public string PluginSettings { get; }
public string LoginError { get; }
public string LabelUrl { get; }
public string LabelTimeout { get; }
public string LabelUser { get; }
public string LabelPassword { get; }
public string LoginTitle { get; }
public string Ok { get; }
public string Cancel { get; }
public string OpenPageAfterUpload { get; }
public string UploadFormat { get; }
public string CopyWikimarkup { get; }
public string Filename { get; }
public string Upload { get; }
public string UploadMenuItem { get; }
public string OpenPages { get; }
public string SearchPages { get; }
public string BrowsePages { get; }
public string SearchText { get; }
public string Search { get; }
public string Loading { get; }
public string IncludePersonSpaces { get; }
public string CommunicationWait { get; }
#endregion
}
}

View file

@ -24,8 +24,9 @@
using Autofac;
using Dapplo.Addons;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.Ini;
using Dapplo.Language;
using Dapplo.Config.Ini;
using Dapplo.Config.Language;
using Greenshot.Addon.Confluence.Configuration.Impl;
using Greenshot.Addon.Confluence.ViewModels;
using Greenshot.Addons.Components;
@ -37,19 +38,22 @@ namespace Greenshot.Addon.Confluence
protected override void Load(ContainerBuilder builder)
{
builder
.Register(context => IniConfig.Current.Get<IConfluenceConfiguration>())
.RegisterType<ConfluenceConfigurationImpl>()
.As<IConfluenceConfiguration>()
.As<IIniSection>()
.SingleInstance();
builder
.Register(context => LanguageLoader.Current.Get<IConfluenceLanguage>())
.RegisterType<ConfluenceLanguageImpl>()
.As<IConfluenceLanguage>()
.As<ILanguage>()
.SingleInstance();
builder
.RegisterType<ConfluenceDestination>()
.As<IDestination>()
.SingleInstance();
builder
.RegisterType<ConfluenceConfigViewModel>()
.As<IConfigScreen>()

View file

@ -6,4 +6,5 @@
Dapplo.HttpExtensions.JsonSimple
</IncludeAssemblies>
</Costura>
<AutoProperties />
</Weavers>

View file

@ -1,29 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<Project Sdk="Microsoft.NET.Sdk.Wpf">
<PropertyGroup>
<ProjectGuid>{C3052651-598A-44E2-AAB3-2E41311D50F9}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Greenshot.Addon.Confluence</RootNamespace>
<AssemblyName>Greenshot.Addon.Confluence</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
@ -31,11 +24,8 @@
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.Caching" />
@ -46,93 +36,34 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="UIAutomationClient">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="UIAutomationTypes">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
<Reference Include="UIAutomationClient" />
<Reference Include="UIAutomationTypes" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConfluenceAddonModule.cs" />
<Compile Include="IConfluenceLanguage.cs" />
<Compile Include="IConfluenceConfiguration.cs" />
<Compile Include="ConfluenceDestination.cs" />
<Compile Include="ConfluenceUtils.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\ConfluenceConfigViewModel.cs" />
<Resource Include="Images\Confluence.ico" />
<None Include="app.config" />
<None Include="Languages\language_confluence-de-DE.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_confluence-en-US.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_confluence-nl-NL.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="Views\ConfluenceConfigView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<ProjectReference Include="..\Greenshot.Addon.InternetExplorer\Greenshot.Addon.InternetExplorer.csproj" />
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Greenshot.Addon.InternetExplorer\Greenshot.Addon.InternetExplorer.csproj">
<Project>{4cca2717-b8a4-44f7-965b-5687107e4921}</Project>
<Name>Greenshot.Addon.InternetExplorer</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
<Name>Greenshot.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj">
<Project>{f041c685-eb96-4ed1-9ace-0f5bd836610f}</Project>
<Name>Greenshot.Gfx</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>Greenshot.Addons</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.Confluence">
<Version>0.7.19</Version>
</PackageReference>
<PackageReference Include="Dapplo.HttpExtensions.JsonSimple">
<Version>0.8.46</Version>
</PackageReference>
<PackageReference Include="Dapplo.HttpExtensions.OAuth">
<Version>0.8.46</Version>
</PackageReference>
<PackageReference Include="Dapplo.Windows.Clipboard">
<Version>0.5.112</Version>
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.11" />
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.11" />
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.19" />
<PackageReference Include="Dapplo.Confluence" Version="0.8.12" />
<PackageReference Include="Fody" Version="3.2.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
</PropertyGroup>
</Project>

View file

@ -1,53 +0,0 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
#region Usings
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot.Addon.Confluence")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot")]
[assembly: AssemblyProduct("Confluence Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2007-2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version, replaced by build scripts
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

View file

@ -12,11 +12,11 @@
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0' ">
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471' ">
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />

View file

@ -26,7 +26,7 @@ using System.IO;
using Greenshot.Addon.ExternalCommand.Entities;
using Greenshot.Addons.Core;
namespace Greenshot.Addon.ExternalCommand
namespace Greenshot.Addon.ExternalCommand.Configuration
{
/// <summary>
/// Helper extensions for the external command configuration

View file

@ -25,21 +25,20 @@
using System.Collections.Generic;
using System.ComponentModel;
using Dapplo.Ini;
using Dapplo.InterfaceImpl.Extensions;
using Dapplo.Config.Ini;
using Greenshot.Addon.ExternalCommand.Entities;
using Greenshot.Addons.Core;
#endregion
namespace Greenshot.Addon.ExternalCommand
namespace Greenshot.Addon.ExternalCommand.Configuration
{
/// <summary>
/// Description of FlickrConfiguration.
/// </summary>
[IniSection("ExternalCommand")]
[Description("Greenshot ExternalCommand Plugin configuration")]
public interface IExternalCommandConfiguration : IIniSection, IDestinationFileConfiguration, ITransactionalProperties, INotifyPropertyChanged
public interface IExternalCommandConfiguration : IIniSection, IDestinationFileConfiguration
{
[Description("The commands that are available.")]
IList<string> Commands { get; set; }

View file

@ -22,9 +22,9 @@
#endregion
using System.ComponentModel;
using Dapplo.Language;
using Dapplo.Config.Language;
namespace Greenshot.Addon.ExternalCommand
namespace Greenshot.Addon.ExternalCommand.Configuration
{
[Language("ExternalCommand")]
public interface IExternalCommandLanguage : ILanguage, INotifyPropertyChanged

View file

@ -0,0 +1,77 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System.Collections.Generic;
using Dapplo.Config.Ini;
using Greenshot.Addon.ExternalCommand.Entities;
using Greenshot.Core.Enums;
namespace Greenshot.Addon.ExternalCommand.Configuration.Impl
{
public class ExternalCommandConfigurationImpl : IniSectionBase<IExternalCommandConfiguration>, IExternalCommandConfiguration
{
#region Overrides of IniSectionBase<IExternalCommandConfiguration>
public override void AfterLoad()
{
ExternalCommandConfigurationExtensions.AfterLoad(this);
base.AfterLoad();
}
#endregion
#region Implementation of IFileConfiguration
public string OutputFilePath { get; set; }
public bool OutputFileAllowOverwrite { get; set; }
public string OutputFileFilenamePattern { get; set; }
public OutputFormats OutputFileFormat { get; set; }
public bool OutputFileReduceColors { get; set; }
public bool OutputFileAutoReduceColors { get; set; }
public int OutputFileReduceColorsTo { get; set; }
public int OutputFileJpegQuality { get; set; }
public bool OutputFilePromptQuality { get; set; }
public uint OutputFileIncrementingNumber { get; set; }
public string OptimizePNGCommand { get; set; }
public string OptimizePNGCommandArguments { get; set; }
#endregion
#region Implementation of IDestinationFileConfiguration
public bool UseOwnSettings { get; set; }
#endregion
#region Implementation of IExternalCommandConfiguration
public IList<string> Commands { get; set; }
public IDictionary<string, string> Commandline { get; set; }
public IDictionary<string, string> Argument { get; set; }
public IDictionary<string, bool> RunInbackground { get; set; }
public IDictionary<string, CommandBehaviors> Behaviors { get; set; }
public IList<string> DeletedBuildInCommands { get; set; }
#endregion
}
}

View file

@ -0,0 +1,45 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Language;
namespace Greenshot.Addon.ExternalCommand.Configuration.Impl
{
public class ExternalCommandLanguageImpl : LanguageBase<IExternalCommandLanguage>, IExternalCommandLanguage
{
#region Implementation of IExternalCommandLanguage
public string ContextmenuConfigure { get; }
public string SettingsEdit { get; }
public string SettingsDelete { get; }
public string SettingsNew { get; }
public string SettingsDetailTitle { get; }
public string SettingsTitle { get; }
public string LabelArgument { get; }
public string LabelCommand { get; }
public string LabelInformation { get; }
public string LabelName { get; }
#endregion
}
}

View file

@ -24,8 +24,10 @@
using Autofac;
using Dapplo.Addons;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.Ini;
using Dapplo.Language;
using Dapplo.Config.Ini;
using Dapplo.Config.Language;
using Greenshot.Addon.ExternalCommand.Configuration;
using Greenshot.Addon.ExternalCommand.Configuration.Impl;
using Greenshot.Addon.ExternalCommand.ViewModels;
using Greenshot.Addons.Components;
@ -37,13 +39,15 @@ namespace Greenshot.Addon.ExternalCommand
protected override void Load(ContainerBuilder builder)
{
builder
.Register(context => IniConfig.Current.Get<IExternalCommandConfiguration>())
.RegisterType<ExternalCommandConfigurationImpl>()
.As<IExternalCommandConfiguration>()
.As<IIniSection>()
.SingleInstance();
builder
.Register(context => LanguageLoader.Current.Get<IExternalCommandLanguage>())
.RegisterType<ExternalCommandLanguageImpl>()
.As<IExternalCommandLanguage>()
.As<ILanguage>()
.SingleInstance();
builder
@ -60,20 +64,7 @@ namespace Greenshot.Addon.ExternalCommand
.AsSelf()
.SingleInstance();
builder.RegisterType<SetupConfig>()
.As<IStartable>()
.SingleInstance();
base.Load(builder);
}
/// <inheritdoc />
private class SetupConfig : IStartable
{
public void Start()
{
IniConfig.Current.AfterLoad<IExternalCommandConfiguration>(externalCommandConfiguration => externalCommandConfiguration.AfterLoad());
}
}
}
}

View file

@ -29,6 +29,7 @@ using System.Text.RegularExpressions;
using System.Threading.Tasks;
using CliWrap;
using Dapplo.Windows.Clipboard;
using Greenshot.Addon.ExternalCommand.Configuration;
using Greenshot.Addon.ExternalCommand.Entities;
using Greenshot.Addons;
using Greenshot.Addons.Components;
@ -83,11 +84,11 @@ namespace Greenshot.Addon.ExternalCommand
var fullPath = captureDetails.Filename ?? surface.SaveNamedTmpFile(CoreConfiguration, _externalCommandConfiguration);
using (var cli = new Cli(_externalCommandDefinition.Command))
{
var cli = new Cli(_externalCommandDefinition.Command);
var arguments = string.Format(_externalCommandDefinition.Arguments, fullPath);
// Execute
var output = await cli.ExecuteAsync(arguments).ConfigureAwait(true);
cli.SetArguments(arguments);
var output = await cli.ExecuteAsync().ConfigureAwait(true);
if (_externalCommandDefinition.CommandBehavior.HasFlag(CommandBehaviors.ParseOutputForUris))
{
@ -108,7 +109,6 @@ namespace Greenshot.Addon.ExternalCommand
{
File.Delete(fullPath);
}
}
_exportNotification.NotifyOfExport(this, exportInformation, surface);
return exportInformation;

View file

@ -30,6 +30,7 @@ using System.Linq;
using Dapplo.Addons;
using Dapplo.CaliburnMicro;
using Dapplo.Log;
using Greenshot.Addon.ExternalCommand.Configuration;
using Greenshot.Addons;
using Greenshot.Addons.Components;
using Greenshot.Addons.Core;
@ -41,7 +42,7 @@ namespace Greenshot.Addon.ExternalCommand
/// <summary>
/// Generate the external command destinations
/// </summary>
[Service(nameof(ExternalCommandDestinationProvider), nameof(CaliburnServices.IniSectionService))]
[Service(nameof(ExternalCommandDestinationProvider), nameof(CaliburnServices.ConfigurationService))]
public sealed class ExternalCommandDestinationProvider : IStartup, IDestinationProvider
{
private static readonly LogSource Log = new LogSource();

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<AutoProperties />
</Weavers>

View file

@ -1,42 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<Project Sdk="Microsoft.NET.Sdk.Wpf">
<PropertyGroup>
<ProjectGuid>{47F23C86-604E-4CC3-8767-B3D4088F30BB}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Greenshot.Addon.ExternalCommand</RootNamespace>
<AssemblyName>Greenshot.Addon.ExternalCommand</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
@ -53,121 +33,22 @@
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Entities\CommandBehaviors.cs" />
<Compile Include="Entities\ExternalCommandDefinition.cs" />
<Compile Include="ExternalCommandConfigurationExtensions.cs" />
<Compile Include="ExternalCommandDestination.cs" />
<Compile Include="ExternalCommandDestinationProvider.cs" />
<Compile Include="IExternalCommandLanguage.cs" />
<Compile Include="IconCache.cs" />
<Compile Include="ExternalCommandAddonModule.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="IExternalCommandConfiguration.cs" />
<Compile Include="ViewModels\ExternalCommandConfigViewModel.cs" />
<Compile Include="ViewModels\ExternalCommandDetailsViewModel.cs" />
<Compile Include="ViewModels\ExternalCommandMasterViewModel.cs" />
<None Include="app.config" />
<None Include="Languages\language_externalcommandplugin-en-US.xml" />
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
<Name>Greenshot.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj">
<Project>{f041c685-eb96-4ed1-9ace-0f5bd836610f}</Project>
<Name>Greenshot.Gfx</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>Greenshot.Addons</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Languages\language_externalcommandplugin-cs-CZ.xml" />
<Content Include="Languages\language_externalcommandplugin-de-DE.xml" />
<Content Include="Languages\language_externalcommandplugin-fr-FR.xml" />
<Content Include="Languages\language_externalcommandplugin-id-ID.xml" />
<Content Include="Languages\language_externalcommandplugin-it-IT.xml" />
<Content Include="Languages\language_externalcommandplugin-kab-DZ.xml" />
<Content Include="Languages\language_externalcommandplugin-ko-KR.xml" />
<Content Include="Languages\language_externalcommandplugin-lv-LV.xml" />
<Content Include="Languages\language_externalcommandplugin-pl-PL.xml" />
<Content Include="Languages\language_externalcommandplugin-pt-PT.xml" />
<Content Include="Languages\language_externalcommandplugin-ru-RU.xml" />
<Content Include="Languages\language_externalcommandplugin-sk-SK.xml" />
<Content Include="Languages\language_externalcommandplugin-sr-RS.xml" />
<Content Include="Languages\language_externalcommandplugin-sv-SE.xml" />
<Content Include="Languages\language_externalcommandplugin-uk-UA.xml" />
<Content Include="Languages\language_externalcommandplugin-zh-CN.xml" />
<Content Include="Languages\language_externalcommandplugin-zh-TW.xml" />
</ItemGroup>
<ItemGroup>
<Page Include="Views\ExternalCommandConfigView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\ExternalCommandDetailsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ExternalCommandMasterView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CliWrap">
<Version>1.8.5</Version>
</PackageReference>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.Windows.Clipboard">
<Version>0.5.112</Version>
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.19" />
<PackageReference Include="CliWrap" Version="2.1.0" />
<PackageReference Include="Fody" Version="3.2.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\CliWrap.dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>x86</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>TRACE</DefineConstants>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DebugType>None</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
</Project>

View file

@ -1,53 +0,0 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
#region Usings
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot.Addon.ExternalCommand")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot")]
[assembly: AssemblyProduct("External command Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2007-2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version, replaced by build scripts
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

View file

@ -25,6 +25,7 @@ using System.Reactive.Disposables;
using Caliburn.Micro;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.CaliburnMicro.Extensions;
using Greenshot.Addon.ExternalCommand.Configuration;
using Greenshot.Addons;
using Greenshot.Addons.Core.Enums;
using Greenshot.Addons.ViewModels;

View file

@ -22,6 +22,7 @@
#endregion
using Caliburn.Micro;
using Greenshot.Addon.ExternalCommand.Configuration;
using Greenshot.Addon.ExternalCommand.Entities;
namespace Greenshot.Addon.ExternalCommand.ViewModels

View file

@ -23,6 +23,7 @@
using System.Linq;
using Caliburn.Micro;
using Greenshot.Addon.ExternalCommand.Configuration;
using Greenshot.Addon.ExternalCommand.Entities;
namespace Greenshot.Addon.ExternalCommand.ViewModels

View file

@ -25,14 +25,13 @@
using System.ComponentModel;
using System.Runtime.Serialization;
using Dapplo.Config.Ini;
using Dapplo.HttpExtensions.OAuth;
using Dapplo.Ini;
using Dapplo.InterfaceImpl.Extensions;
using Greenshot.Addons.Core;
#endregion
namespace Greenshot.Addon.Flickr
namespace Greenshot.Addon.Flickr.Configuration
{
public enum SafetyLevel
{
@ -46,7 +45,7 @@ namespace Greenshot.Addon.Flickr
/// </summary>
[IniSection("Flickr")]
[Description("Greenshot Flickr Plugin configuration")]
public interface IFlickrConfiguration : IIniSection, IDestinationFileConfiguration, INotifyPropertyChanged, ITransactionalProperties, IOAuth1Token
public interface IFlickrConfiguration : IIniSection, IDestinationFileConfiguration, IOAuth1Token
{
[Description("IsPublic.")]
[DefaultValue(true)]

View file

@ -20,11 +20,11 @@
#region Usings
using System.ComponentModel;
using Dapplo.Language;
using Dapplo.Config.Language;
#endregion
namespace Greenshot.Addon.Flickr
namespace Greenshot.Addon.Flickr.Configuration
{
[Language("Flickr")]
public interface IFlickrLanguage : ILanguage, INotifyPropertyChanged

View file

@ -0,0 +1,76 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Ini;
using Greenshot.Core.Enums;
namespace Greenshot.Addon.Flickr.Configuration.Impl
{
public class FlickrConfigurationImpl : IniSectionBase<IFlickrConfiguration>, IFlickrConfiguration
{
#region Implementation of IFileConfiguration
public string OutputFilePath { get; set; }
public bool OutputFileAllowOverwrite { get; set; }
public string OutputFileFilenamePattern { get; set; }
public OutputFormats OutputFileFormat { get; set; }
public bool OutputFileReduceColors { get; set; }
public bool OutputFileAutoReduceColors { get; set; }
public int OutputFileReduceColorsTo { get; set; }
public int OutputFileJpegQuality { get; set; }
public bool OutputFilePromptQuality { get; set; }
public uint OutputFileIncrementingNumber { get; set; }
public string OptimizePNGCommand { get; set; }
public string OptimizePNGCommandArguments { get; set; }
#endregion
#region Implementation of IDestinationFileConfiguration
public bool UseOwnSettings { get; set; }
#endregion
#region Implementation of IOAuth1Token
public string OAuthToken { get; set; }
public string OAuthTokenSecret { get; set; }
public string OAuthTokenVerifier { get; set; }
#endregion
#region Implementation of IFlickrConfiguration
public bool IsPublic { get; set; }
public bool IsFamily { get; set; }
public bool IsFriend { get; set; }
public SafetyLevel SafetyLevel { get; set; }
public bool HiddenFromSearch { get; set; }
public bool AfterUploadLinkToClipBoard { get; set; }
public bool UsePageLink { get; set; }
public string ClientId { get; set; }
public string ClientSecret { get; set; }
#endregion
}
}

View file

@ -0,0 +1,49 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Language;
namespace Greenshot.Addon.Flickr.Configuration.Impl
{
public class FlickrLanguageImpl : LanguageBase<IFlickrLanguage>, IFlickrLanguage
{
#region Implementation of IFlickrLanguage
public string CommunicationWait { get; }
public string Configure { get; }
public string LabelAfterUpload { get; }
public string LabelAfterUploadLinkToClipBoard { get; }
public string LabelHiddenFromSearch { get; }
public string LabelSafetyLevel { get; }
public string LabelUploadFormat { get; }
public string SettingsTitle { get; }
public string UploadFailure { get; }
public string UploadMenuItem { get; }
public string UploadSuccess { get; }
public string Public { get; }
public string Family { get; }
public string Friend { get; }
#endregion
}
}

View file

@ -24,8 +24,10 @@
using Autofac;
using Dapplo.Addons;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.Ini;
using Dapplo.Language;
using Dapplo.Config.Ini;
using Dapplo.Config.Language;
using Greenshot.Addon.Flickr.Configuration;
using Greenshot.Addon.Flickr.Configuration.Impl;
using Greenshot.Addon.Flickr.ViewModels;
using Greenshot.Addons.Components;
@ -37,13 +39,15 @@ namespace Greenshot.Addon.Flickr
protected override void Load(ContainerBuilder builder)
{
builder
.Register(context => IniConfig.Current.Get<IFlickrConfiguration>())
.RegisterType<FlickrConfigurationImpl>()
.As<IFlickrConfiguration>()
.As<IIniSection>()
.SingleInstance();
builder
.Register(context => LanguageLoader.Current.Get<IFlickrLanguage>())
.RegisterType<FlickrLanguageImpl>()
.As<IFlickrLanguage>()
.As<ILanguage>()
.SingleInstance();
builder

View file

@ -41,6 +41,7 @@ using Dapplo.HttpExtensions.Extensions;
using Dapplo.HttpExtensions.OAuth;
using Dapplo.Log;
using Dapplo.Windows.Clipboard;
using Greenshot.Addon.Flickr.Configuration;
using Greenshot.Addons;
using Greenshot.Addons.Components;
using Greenshot.Addons.Controls;

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<AutoProperties />
</Weavers>

View file

@ -1,42 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<Project Sdk="Microsoft.NET.Sdk.Wpf">
<PropertyGroup>
<ProjectGuid>{7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Greenshot.Addon.Flickr</RootNamespace>
<AssemblyName>Greenshot.Addon.Flickr</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
@ -57,85 +37,26 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="FlickrAddonModule.cs" />
<Compile Include="FlickrDestination.cs" />
<Compile Include="IFlickrConfiguration.cs" />
<Compile Include="IFlickrLanguage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\FlickrConfigViewModel.cs" />
<None Include="app.config" />
<None Include="Languages\language_flickrplugin-en-US.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="flickr.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>Greenshot.Addons</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
<Name>Greenshot.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj">
<Project>{f041c685-eb96-4ed1-9ace-0f5bd836610f}</Project>
<Name>Greenshot.Gfx</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
</ItemGroup>
<ItemGroup>
<Resource Include="Languages\language_flickrplugin-cs-CZ.xml" />
<Resource Include="Languages\language_flickrplugin-de-DE.xml" />
<Resource Include="Languages\language_flickrplugin-fr-FR.xml" />
<Resource Include="Languages\language_flickrplugin-id-ID.xml" />
<Resource Include="Languages\language_flickrplugin-it-IT.xml" />
<Resource Include="Languages\language_flickrplugin-ja-JP.xml" />
<Resource Include="Languages\language_flickrplugin-kab-DZ.xml" />
<Resource Include="Languages\language_flickrplugin-ko-KR.xml" />
<Resource Include="Languages\language_flickrplugin-lv-LV.xml" />
<Resource Include="Languages\language_flickrplugin-pl-PL.xml" />
<Resource Include="Languages\language_flickrplugin-pt-PT.xml" />
<Resource Include="Languages\language_flickrplugin-ru-RU.xml" />
<Resource Include="Languages\language_flickrplugin-sr-Cyrl-RS.xml" />
<Resource Include="Languages\language_flickrplugin-sv-SE.xml" />
<Resource Include="Languages\language_flickrplugin-uk-UA.xml" />
<Resource Include="Languages\language_flickrplugin-zh-CN.xml" />
<Resource Include="Languages\language_flickrplugin-zh-TW.xml" />
</ItemGroup>
<ItemGroup>
<Page Include="Views\FlickrConfigView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.HttpExtensions.OAuth">
<Version>0.8.46</Version>
</PackageReference>
<PackageReference Include="Dapplo.Windows.Clipboard">
<Version>0.5.112</Version>
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.11" />
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.19" />
<PackageReference Include="Fody" Version="3.2.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
</Project>

View file

@ -1,53 +0,0 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
#region Usings
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot.Addon.Flickr")]
[assembly: AssemblyDescription("A plugin to upload images to Flickr")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot & F. Noel")]
[assembly: AssemblyProduct("Flickr Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version, replaced by build scripts
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

View file

@ -25,6 +25,7 @@ using System.Collections.Generic;
using System.Reactive.Disposables;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.CaliburnMicro.Extensions;
using Greenshot.Addon.Flickr.Configuration;
using Greenshot.Addons.Core.Enums;
using Greenshot.Addons.Extensions;
using Greenshot.Addons.ViewModels;

View file

@ -25,21 +25,20 @@
using System.ComponentModel;
using System.Runtime.Serialization;
using Dapplo.Config.Ini;
using Dapplo.HttpExtensions.OAuth;
using Dapplo.Ini;
using Dapplo.InterfaceImpl.Extensions;
using Greenshot.Addons.Core;
#endregion
namespace Greenshot.Addon.GooglePhotos
namespace Greenshot.Addon.GooglePhotos.Configuration
{
/// <summary>
/// Description of GooglePhotosConfiguration.
/// </summary>
[IniSection("GooglePhotos")]
[Description("Greenshot Google Photos Plugin configuration")]
public interface IGooglePhotosConfiguration : IIniSection, IDestinationFileConfiguration, IOAuth2Token, ITransactionalProperties
public interface IGooglePhotosConfiguration : IIniSection, IDestinationFileConfiguration, IOAuth2Token
{
[Description("After upload send Google Photos link to clipboard.")]
[DefaultValue(true)]

View file

@ -1,7 +1,7 @@
using System.ComponentModel;
using Dapplo.Language;
using Dapplo.Config.Language;
namespace Greenshot.Addon.GooglePhotos
namespace Greenshot.Addon.GooglePhotos.Configuration
{
[Language("GooglePhotos")]
public interface IGooglePhotosLanguage : ILanguage, INotifyPropertyChanged

View file

@ -0,0 +1,74 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using Dapplo.Config.Ini;
using Greenshot.Core.Enums;
namespace Greenshot.Addon.GooglePhotos.Configuration.Impl
{
public class GooglePhotosConfigurationImpl : IniSectionBase<IGooglePhotosConfiguration>, IGooglePhotosConfiguration
{
#region Implementation of IFileConfiguration
public string OutputFilePath { get; set; }
public bool OutputFileAllowOverwrite { get; set; }
public string OutputFileFilenamePattern { get; set; }
public OutputFormats OutputFileFormat { get; set; }
public bool OutputFileReduceColors { get; set; }
public bool OutputFileAutoReduceColors { get; set; }
public int OutputFileReduceColorsTo { get; set; }
public int OutputFileJpegQuality { get; set; }
public bool OutputFilePromptQuality { get; set; }
public uint OutputFileIncrementingNumber { get; set; }
public string OptimizePNGCommand { get; set; }
public string OptimizePNGCommandArguments { get; set; }
#endregion
#region Implementation of IDestinationFileConfiguration
public bool UseOwnSettings { get; set; }
#endregion
#region Implementation of IOAuth2Token
public string OAuth2AccessToken { get; set; }
public DateTimeOffset OAuth2AccessTokenExpires { get; set; }
public string OAuth2RefreshToken { get; set; }
#endregion
#region Implementation of IGooglePhotosConfiguration
public bool AfterUploadLinkToClipBoard { get; set; }
public bool AddFilename { get; set; }
public string UploadUser { get; set; }
public string UploadAlbum { get; set; }
public string ClientId { get; set; }
public string ClientSecret { get; set; }
#endregion
}
}

View file

@ -0,0 +1,44 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Language;
namespace Greenshot.Addon.GooglePhotos.Configuration.Impl
{
public class GooglePhotosLanguageImpl : LanguageBase<IGooglePhotosLanguage>, IGooglePhotosLanguage
{
#region Implementation of IGooglePhotosLanguage
public string CommunicationWait { get; }
public string Configure { get; }
public string LabelAfterUpload { get; }
public string LabelAfterUploadLinkToClipBoard { get; }
public string LabelUploadFormat { get; }
public string SettingsTitle { get; }
public string UploadFailure { get; }
public string UploadMenuItem { get; }
public string UploadSuccess { get; }
#endregion
}
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<AutoProperties />
</Weavers>

View file

@ -24,8 +24,10 @@
using Autofac;
using Dapplo.Addons;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.Ini;
using Dapplo.Language;
using Dapplo.Config.Ini;
using Dapplo.Config.Language;
using Greenshot.Addon.GooglePhotos.Configuration;
using Greenshot.Addon.GooglePhotos.Configuration.Impl;
using Greenshot.Addon.GooglePhotos.ViewModels;
using Greenshot.Addons.Components;
@ -37,13 +39,15 @@ namespace Greenshot.Addon.GooglePhotos
protected override void Load(ContainerBuilder builder)
{
builder
.Register(context => IniConfig.Current.Get<IGooglePhotosConfiguration>())
.RegisterType<GooglePhotosConfigurationImpl>()
.As<IGooglePhotosConfiguration>()
.As<IIniSection>()
.SingleInstance();
builder
.Register(context => LanguageLoader.Current.Get<IGooglePhotosLanguage>())
.RegisterType<GooglePhotosLanguageImpl>()
.As<IGooglePhotosLanguage>()
.As<ILanguage>()
.SingleInstance();
builder

View file

@ -39,6 +39,7 @@ using Dapplo.HttpExtensions.OAuth;
using Dapplo.Log;
using Dapplo.Utils;
using Dapplo.Windows.Clipboard;
using Greenshot.Addon.GooglePhotos.Configuration;
using Greenshot.Addons;
using Greenshot.Addons.Components;
using Greenshot.Addons.Controls;

View file

@ -1,28 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<Project Sdk="Microsoft.NET.Sdk.Wpf">
<PropertyGroup>
<ProjectGuid>{1893A2E4-A78A-4713-A8E7-E70058DABEE0}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Greenshot.Addon.GooglePhotos</RootNamespace>
<AssemblyName>Greenshot.Addon.GooglePhotos</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
@ -43,76 +37,26 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<Compile Include="GooglePhotosAddonModule.cs" />
<Compile Include="IGooglePhotosLanguage.cs" />
<Compile Include="IGooglePhotosConfiguration.cs" />
<Compile Include="GooglePhotosDestination.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\GooglePhotosConfigViewModel.cs" />
<Content Include="Languages\language_googlephotosplugin-en-US.xml" />
<None Include="Languages\language_googlephotosplugin-cs-CZ.xml" />
<None Include="Languages\language_googlephotosplugin-de-DE.xml" />
<None Include="Languages\language_googlephotosplugin-id-ID.xml" />
<None Include="Languages\language_googlephotosplugin-kab-DZ.xml" />
<None Include="Languages\language_googlephotosplugin-ko-KR.xml" />
<None Include="Languages\language_googlephotosplugin-lv-LV.xml" />
<None Include="Languages\language_googlephotosplugin-pl-PL.xml" />
<None Include="Languages\language_googlephotosplugin-pt-PT.xml" />
<None Include="Languages\language_googlephotosplugin-sv-SE.xml" />
<None Include="Languages\language_googlephotosplugin-zh-TW.xml" />
<None Include="Languages\language_googlephotosplugin-fr-FR.xml" />
<None Include="Languages\language_googlephotosplugin-it-IT.xml" />
<None Include="Languages\language_googlephotosplugin-ru-RU.xml" />
<None Include="Languages\language_googlephotosplugin-uk-UA.xml" />
<None Include="Languages\language_googlephotosplugin-zh-CN.xml" />
<EmbeddedResource Include="GooglePhotos.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>Greenshot.Addons</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
<Name>Greenshot.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj">
<Project>{f041c685-eb96-4ed1-9ace-0f5bd836610f}</Project>
<Name>Greenshot.Gfx</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
</ItemGroup>
<ItemGroup>
<Page Include="Views\GooglePhotosConfigView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.HttpExtensions.OAuth">
<Version>0.8.46</Version>
</PackageReference>
<PackageReference Include="Dapplo.Windows.Clipboard">
<Version>0.5.112</Version>
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.11" />
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.19" />
<PackageReference Include="Fody" Version="3.2.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
</Project>

View file

@ -1,53 +0,0 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
#region Usings
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot.Addon.GooglePhotos")]
[assembly: AssemblyDescription("A plugin to upload images to Google Photos")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot & F. Noel")]
[assembly: AssemblyProduct("GooglePhotos Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version, replaced by build scripts
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

View file

@ -24,6 +24,7 @@
using System.Reactive.Disposables;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.CaliburnMicro.Extensions;
using Greenshot.Addon.GooglePhotos.Configuration;
using Greenshot.Addons.Core.Enums;
using Greenshot.Addons.ViewModels;

View file

@ -26,22 +26,21 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using Dapplo.Config.Ini;
using Dapplo.HttpExtensions.OAuth;
using Dapplo.Ini;
using Dapplo.InterfaceImpl.Extensions;
using Greenshot.Addon.Imgur.Entities;
using Greenshot.Addons.Core;
#endregion
namespace Greenshot.Addon.Imgur
namespace Greenshot.Addon.Imgur.Configuration
{
/// <summary>
/// Description of ImgurConfiguration.
/// </summary>
[IniSection("Imgur")]
[Description("Greenshot Imgur Plugin configuration")]
public interface IImgurConfiguration : IIniSection, IDestinationFileConfiguration, IOAuth2Token, ITransactionalProperties, INotifyPropertyChanged
public interface IImgurConfiguration : IIniSection, IDestinationFileConfiguration, IOAuth2Token
{
[Description("Url to Imgur system.")]
[DefaultValue("https://api.imgur.com/3")]

View file

@ -20,11 +20,11 @@
#region Usings
using System.ComponentModel;
using Dapplo.Language;
using Dapplo.Config.Language;
#endregion
namespace Greenshot.Addon.Imgur
namespace Greenshot.Addon.Imgur.Configuration
{
[Language("Imgur")]
public interface IImgurLanguage : ILanguage, INotifyPropertyChanged

View file

@ -0,0 +1,84 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using Dapplo.Config.Ini;
using Greenshot.Addon.Imgur.Entities;
using Greenshot.Core.Enums;
namespace Greenshot.Addon.Imgur.Configuration.Impl
{
public class ImgurConfigurationImpl : IniSectionBase<IImgurConfiguration>, IImgurConfiguration
{
#region Implementation of IFileConfiguration
public string OutputFilePath { get; set; }
public bool OutputFileAllowOverwrite { get; set; }
public string OutputFileFilenamePattern { get; set; }
public OutputFormats OutputFileFormat { get; set; }
public bool OutputFileReduceColors { get; set; }
public bool OutputFileAutoReduceColors { get; set; }
public int OutputFileReduceColorsTo { get; set; }
public int OutputFileJpegQuality { get; set; }
public bool OutputFilePromptQuality { get; set; }
public uint OutputFileIncrementingNumber { get; set; }
public string OptimizePNGCommand { get; set; }
public string OptimizePNGCommandArguments { get; set; }
#endregion
#region Implementation of IDestinationFileConfiguration
public bool UseOwnSettings { get; set; }
#endregion
#region Implementation of IOAuth2Token
public string OAuth2AccessToken { get; set; }
public DateTimeOffset OAuth2AccessTokenExpires { get; set; }
public string OAuth2RefreshToken { get; set; }
#endregion
#region Implementation of IImgurConfiguration
public string ImgurApi3Url { get; set; }
public bool CopyLinkToClipboard { get; set; }
public bool UsePageLink { get; set; }
public bool AnonymousAccess { get; set; }
public string ClientId { get; set; }
public string ClientSecret { get; set; }
public string ApiUrl { get; set; }
public bool AddTitle { get; set; }
public bool AddFilename { get; set; }
public string FilenamePattern { get; set; }
public bool TrackHistory { get; set; }
public IDictionary<string, string> ImgurUploadHistory { get; set; }
public int Credits { get; set; }
public IDictionary<string, ImgurImage> RuntimeImgurHistory { get; set; }
#endregion
}
}

View file

@ -0,0 +1,53 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Language;
namespace Greenshot.Addon.Imgur.Configuration.Impl
{
public class ImgurLanguageImpl : LanguageBase<IImgurLanguage>, IImgurLanguage
{
#region Implementation of IImgurLanguage
public string Cancel { get; }
public string ClearQuestion { get; }
public string CommunicationWait { get; }
public string Configure { get; }
public string DeleteQuestion { get; }
public string DeleteTitle { get; }
public string History { get; }
public string LabelClear { get; }
public string LabelUploadFormat { get; }
public string LabelUrl { get; }
public string Ok { get; }
public string SettingsTitle { get; }
public string UploadFailure { get; }
public string UploadMenuItem { get; }
public string UploadSuccess { get; }
public string UsePageLink { get; }
public string AnonymousAccess { get; }
public string ResetCredentialsButton { get; }
#endregion
}
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<AutoProperties />
</Weavers>

View file

@ -1,44 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<Project Sdk="Microsoft.NET.Sdk.Wpf">
<PropertyGroup>
<ProjectGuid>{80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Greenshot.Addon.Imgur</RootNamespace>
<AssemblyName>Greenshot.Addon.Imgur</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
@ -59,87 +37,28 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Entities\ImgurData.cs" />
<Compile Include="Entities\ImgurImage.cs" />
<Compile Include="ImgurAddonModule.cs" />
<Compile Include="IImgurLanguage.cs" />
<Compile Include="ImgurApi.cs" />
<Compile Include="ImgurDestination.cs" />
<Compile Include="IImgurConfiguration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\ImgurHistoryViewModel.cs" />
<Compile Include="ViewModels\ImgurConfigViewModel.cs" />
<None Include="app.config" />
<None Include="Languages\language_imgurplugin-de-DE.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_imgurplugin-en-US.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_imgurplugin-fr-FR.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_imgurplugin-nl-NL.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_imgurplugin-zh-CN.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
<Name>Greenshot.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj">
<Project>{f041c685-eb96-4ed1-9ace-0f5bd836610f}</Project>
<Name>Greenshot.Gfx</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>Greenshot.Addons</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Views\ImgurHistoryView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\ImgurConfigView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Imgur.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.HttpExtensions.JsonNet">
<Version>0.8.46</Version>
</PackageReference>
<PackageReference Include="Dapplo.HttpExtensions.OAuth">
<Version>0.8.46</Version>
</PackageReference>
<PackageReference Include="Dapplo.Windows.Clipboard">
<Version>0.5.112</Version>
</PackageReference>
<PackageReference Include="MahApps.Metro">
<Version>1.6.5</Version>
</PackageReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.11" />
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.11" />
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.19" />
<PackageReference Include="Fody" Version="3.2.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="MahApps.Metro" Version="1.6.5" />
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
</PropertyGroup>
</Project>

View file

@ -24,8 +24,10 @@
using Autofac;
using Dapplo.Addons;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.Ini;
using Dapplo.Language;
using Dapplo.Config.Ini;
using Dapplo.Config.Language;
using Greenshot.Addon.Imgur.Configuration;
using Greenshot.Addon.Imgur.Configuration.Impl;
using Greenshot.Addon.Imgur.ViewModels;
using Greenshot.Addons.Components;
@ -37,13 +39,15 @@ namespace Greenshot.Addon.Imgur
protected override void Load(ContainerBuilder builder)
{
builder
.Register(context => IniConfig.Current.Get<IImgurConfiguration>())
.RegisterType<ImgurConfigurationImpl>()
.As<IImgurConfiguration>()
.As<IIniSection>()
.SingleInstance();
builder
.Register(context => LanguageLoader.Current.Get<IImgurLanguage>())
.RegisterType<ImgurLanguageImpl>()
.As<IImgurLanguage>()
.As<ILanguage>()
.SingleInstance();
builder

View file

@ -37,6 +37,7 @@ using Dapplo.HttpExtensions.JsonNet;
using Dapplo.HttpExtensions.OAuth;
using Dapplo.Log;
using Dapplo.Utils;
using Greenshot.Addon.Imgur.Configuration;
using Greenshot.Addon.Imgur.Entities;
using Greenshot.Addons.Core;
using Greenshot.Addons.Extensions;

View file

@ -33,6 +33,7 @@ using Dapplo.Addons;
using Dapplo.Log;
using Dapplo.Windows.Clipboard;
using Dapplo.Windows.Extensions;
using Greenshot.Addon.Imgur.Configuration;
using Greenshot.Addon.Imgur.Entities;
using Greenshot.Addon.Imgur.ViewModels;
using Greenshot.Addons;

View file

@ -1,53 +0,0 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
#region Usings
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot.Addon.Imgur")]
[assembly: AssemblyDescription("A plugin to upload images to Imgur")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot")]
[assembly: AssemblyProduct("Imgur Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2007-2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version, replaced by build scripts
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

View file

@ -28,6 +28,7 @@ using Caliburn.Micro;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.CaliburnMicro.Extensions;
using Dapplo.HttpExtensions.OAuth;
using Greenshot.Addon.Imgur.Configuration;
using Greenshot.Addons.Core.Enums;
using Greenshot.Addons.ViewModels;

View file

@ -32,6 +32,7 @@ using Caliburn.Micro;
using Dapplo.CaliburnMicro.Extensions;
using Dapplo.Log;
using Dapplo.Windows.Clipboard;
using Greenshot.Addon.Imgur.Configuration;
using Greenshot.Addon.Imgur.Entities;
using Greenshot.Addons;
using Greenshot.Addons.Extensions;

View file

@ -24,20 +24,19 @@
#region Usings
using System.ComponentModel;
using Dapplo.Ini;
using Dapplo.InterfaceImpl.Extensions;
using Dapplo.Config.Ini;
using Greenshot.Addons.Core;
#endregion
namespace Greenshot.Addon.Jira
namespace Greenshot.Addon.Jira.Configuration
{
/// <summary>
/// Description of JiraConfiguration.
/// </summary>
[IniSection("Jira")]
[Description("Greenshot Jira Plugin configuration")]
public interface IJiraConfiguration : IIniSection, IDestinationFileConfiguration, INotifyPropertyChanged, ITransactionalProperties
public interface IJiraConfiguration : IIniSection, IDestinationFileConfiguration
{
[Description("Base url to Jira system, without anything else")]
[DefaultValue("https://jira")]

View file

@ -20,11 +20,11 @@
#region Usings
using System.ComponentModel;
using Dapplo.Language;
using Dapplo.Config.Language;
#endregion
namespace Greenshot.Addon.Jira
namespace Greenshot.Addon.Jira.Configuration
{
[Language("Jira")]
public interface IJiraLanguage : ILanguage, INotifyPropertyChanged

View file

@ -0,0 +1,62 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Ini;
using Greenshot.Core.Enums;
namespace Greenshot.Addon.Jira.Configuration.Impl
{
public class JiraConfigurationImpl : IniSectionBase<IJiraConfiguration>, IJiraConfiguration
{
#region Implementation of IFileConfiguration
public string OutputFilePath { get; set; }
public bool OutputFileAllowOverwrite { get; set; }
public string OutputFileFilenamePattern { get; set; }
public OutputFormats OutputFileFormat { get; set; }
public bool OutputFileReduceColors { get; set; }
public bool OutputFileAutoReduceColors { get; set; }
public int OutputFileReduceColorsTo { get; set; }
public int OutputFileJpegQuality { get; set; }
public bool OutputFilePromptQuality { get; set; }
public uint OutputFileIncrementingNumber { get; set; }
public string OptimizePNGCommand { get; set; }
public string OptimizePNGCommandArguments { get; set; }
#endregion
#region Implementation of IDestinationFileConfiguration
public bool UseOwnSettings { get; set; }
#endregion
#region Implementation of IJiraConfiguration
public string Url { get; set; }
public int Timeout { get; set; }
public int MaxEntries { get; set; }
#endregion
}
}

View file

@ -0,0 +1,55 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Language;
namespace Greenshot.Addon.Jira.Configuration.Impl
{
public class JiraLanguageImpl : LanguageBase<IJiraLanguage>, IJiraLanguage
{
#region Implementation of IJiraLanguage
public string Cancel { get; }
public string ColumnAssignee { get; }
public string ColumnCreated { get; }
public string ColumnId { get; }
public string ColumnReporter { get; }
public string ColumnSummary { get; }
public string CommunicationWait { get; }
public string LabelComment { get; }
public string LabelFilename { get; }
public string LabelJira { get; }
public string LabelJirafilter { get; }
public string LabelUploadFormat { get; }
public string LabelUrl { get; }
public string LoginError { get; }
public string LoginTitle { get; }
public string Ok { get; }
public string SettingsTitle { get; }
public string UploadFailure { get; }
public string UploadMenuItem { get; }
public string UploadSuccess { get; }
#endregion
}
}

View file

@ -5,4 +5,5 @@
Dapplo.Jira
</IncludeAssemblies>
</Costura>
<AutoProperties />
</Weavers>

View file

@ -1,44 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<Project Sdk="Microsoft.NET.Sdk.Wpf">
<PropertyGroup>
<ProjectGuid>{19FEEF09-313F-43C7-819D-F1BCA782B08B}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Greenshot.Addon.Jira</RootNamespace>
<AssemblyName>Greenshot.Addon.Jira</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworks>net471</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
@ -61,139 +39,29 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="IJiraLanguage.cs" />
<Compile Include="JiraAddonModule.cs" />
<Compile Include="IssueTypeBitmapCache.cs" />
<Compile Include="JiraConnector.cs" />
<Compile Include="IJiraConfiguration.cs" />
<Compile Include="JiraDestination.cs" />
<Compile Include="JiraDetails.cs" />
<Compile Include="JiraEventArgs.cs" />
<Compile Include="JiraEventTypes.cs" />
<Compile Include="JiraMonitor.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\JiraViewModel.cs" />
<Compile Include="ViewModels\JiraConfigViewModel.cs" />
<None Include="app.config" />
<EmbeddedResource Include="jira.svgz" />
<None Include="Languages\language_jiraplugin-de-DE.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Languages\language_jiraplugin-en-US.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Languages\language_jiraplugin-fr-FR.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Languages\language_jiraplugin-nl-NL.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Languages\language_jiraplugin-zh-CN.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>Greenshot.Addons</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
<Name>Greenshot.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj">
<Project>{f041c685-eb96-4ed1-9ace-0f5bd836610f}</Project>
<Name>Greenshot.Gfx</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
<Resource Include="Languages\language_jiraplugin-cs-CZ.xml" />
<Resource Include="Languages\language_jiraplugin-id-ID.xml" />
<Resource Include="Languages\language_jiraplugin-it-IT.xml" />
<Resource Include="Languages\language_jiraplugin-ja-JP.xml" />
<Resource Include="Languages\language_jiraplugin-kab-DZ.xml" />
<Resource Include="Languages\language_jiraplugin-ko-KR.xml" />
<Resource Include="Languages\language_jiraplugin-lv-LV.xml" />
<Resource Include="Languages\language_jiraplugin-pl-PL.xml" />
<Resource Include="Languages\language_jiraplugin-pt-PT.xml" />
<Resource Include="Languages\language_jiraplugin-ru-RU.xml" />
<Resource Include="Languages\language_jiraplugin-sr-Cyrl-RS.xml" />
<Resource Include="Languages\language_jiraplugin-sr-RS.xml" />
<Resource Include="Languages\language_jiraplugin-sv-SE.xml" />
<Resource Include="Languages\language_jiraplugin-uk-UA.xml" />
<Resource Include="Languages\language_jiraplugin-zh-TW.xml" />
</ItemGroup>
<ItemGroup>
<Page Include="Views\JiraConfigView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\JiraView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.HttpExtensions.JsonNet">
<Version>0.8.46</Version>
</PackageReference>
<PackageReference Include="Dapplo.HttpExtensions.OAuth">
<Version>0.8.46</Version>
</PackageReference>
<PackageReference Include="Dapplo.Jira">
<Version>0.7.15</Version>
</PackageReference>
<PackageReference Include="Dapplo.Windows.Clipboard">
<Version>0.5.112</Version>
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.11" />
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.11" />
<PackageReference Include="Dapplo.Utils" Version="1.1.9" />
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.19" />
<PackageReference Include="Dapplo.Jira" Version="0.8.5" />
<PackageReference Include="Fody" Version="3.2.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\Svg.dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>x86</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>TRACE</DefineConstants>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DebugType>None</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
</Project>

View file

@ -24,8 +24,10 @@
using Autofac;
using Dapplo.Addons;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.Ini;
using Dapplo.Language;
using Dapplo.Config.Ini;
using Dapplo.Config.Language;
using Greenshot.Addon.Jira.Configuration;
using Greenshot.Addon.Jira.Configuration.Impl;
using Greenshot.Addon.Jira.ViewModels;
using Greenshot.Addons.Components;
@ -37,13 +39,15 @@ namespace Greenshot.Addon.Jira
protected override void Load(ContainerBuilder builder)
{
builder
.Register(context => IniConfig.Current.Get<IJiraConfiguration>())
.RegisterType<JiraConfigurationImpl>()
.As<IJiraConfiguration>()
.As<IIniSection>()
.SingleInstance();
builder
.Register(context => LanguageLoader.Current.Get<IJiraLanguage>())
.RegisterType<JiraLanguageImpl>()
.As<IJiraLanguage>()
.As<ILanguage>()
.SingleInstance();
builder

View file

@ -34,9 +34,12 @@ using System.Windows.Media.Imaging;
using Dapplo.HttpExtensions;
using Dapplo.HttpExtensions.Extensions;
using Dapplo.Jira;
#if !NETCOREAPP3_0
using Dapplo.Jira.Converters;
#endif
using Dapplo.Jira.Entities;
using Dapplo.Log;
using Greenshot.Addon.Jira.Configuration;
using Greenshot.Addons.Core;
using Greenshot.Addons.Core.Credentials;
using Greenshot.Addons.Extensions;
@ -102,7 +105,9 @@ namespace Greenshot.Addon.Jira
public void UpdateSvgSize(int size)
{
#if !NETCOREAPP3_0
_jiraClient.Behaviour.SetConfig(new SvgConfiguration { Width = size, Height = size });
#endif
}
/// <summary>

View file

@ -34,6 +34,7 @@ using Dapplo.Addons;
using Dapplo.HttpExtensions;
using Dapplo.Jira.Entities;
using Dapplo.Log;
using Greenshot.Addon.Jira.Configuration;
using Greenshot.Addon.Jira.ViewModels;
using Greenshot.Addons;
using Greenshot.Addons.Components;

View file

@ -36,6 +36,7 @@ using Dapplo.Jira;
using Dapplo.Log;
using Dapplo.Windows.Desktop;
using Dapplo.Windows.User32;
using Greenshot.Addon.Jira.Configuration;
#endregion
@ -46,7 +47,7 @@ namespace Greenshot.Addon.Jira
/// It keeps a list of the last "accessed" jiras, and makes it easy to upload to one.
/// Make sure this is instanciated on the UI thread!
/// </summary>
[Service(nameof(JiraMonitor), nameof(CaliburnServices.IniSectionService), TaskSchedulerName = "ui")]
[Service(nameof(JiraMonitor), nameof(CaliburnServices.ConfigurationService), TaskSchedulerName = "ui")]
public class JiraMonitor : IStartup, IShutdown
{
private readonly IJiraConfiguration _jiraConfiguration;

View file

@ -1,53 +0,0 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
#region Usings
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot.Addon.Jira")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot")]
[assembly: AssemblyProduct("Jira Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2007-2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version, replaced by build scripts
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

View file

@ -24,6 +24,7 @@
using System.Reactive.Disposables;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.CaliburnMicro.Extensions;
using Greenshot.Addon.Jira.Configuration;
using Greenshot.Addons.Core.Enums;
using Greenshot.Addons.ViewModels;

View file

@ -29,6 +29,7 @@ using System.Windows;
using Caliburn.Micro;
using Dapplo.CaliburnMicro.Extensions;
using Dapplo.Jira.Entities;
using Greenshot.Addon.Jira.Configuration;
namespace Greenshot.Addon.Jira.ViewModels
{

View file

@ -21,17 +21,16 @@
using System.Collections.Generic;
using System.ComponentModel;
using Dapplo.Ini;
using Dapplo.InterfaceImpl.Extensions;
using Dapplo.Config.Ini;
using Greenshot.Addons.Core;
namespace Greenshot.Addon.Lutim {
namespace Greenshot.Addon.Lutim.Configuration {
/// <summary>
/// Description of LutimConfiguration.
/// </summary>
[IniSection("Lutim")]
[Description("Greenshot Lutim Plugin configuration")]
public interface ILutimConfiguration : IIniSection, IDestinationFileConfiguration, ITransactionalProperties, INotifyPropertyChanged
public interface ILutimConfiguration : IIniSection, IDestinationFileConfiguration
{
[Description("Url to Lutim system.")]
[DefaultValue("https://lut.im/")]

View file

@ -22,7 +22,7 @@
#endregion
using System.ComponentModel;
using Dapplo.Language;
using Dapplo.Config.Language;
namespace Greenshot.Addon.Lutim
{

View file

@ -0,0 +1,65 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System.Collections.Generic;
using Dapplo.Config.Ini;
using Greenshot.Addon.Lutim.Entities;
using Greenshot.Core.Enums;
namespace Greenshot.Addon.Lutim.Configuration.Impl
{
public class LutimConfigurationImpl : IniSectionBase<ILutimConfiguration>, ILutimConfiguration
{
#region Implementation of IFileConfiguration
public string OutputFilePath { get; set; }
public bool OutputFileAllowOverwrite { get; set; }
public string OutputFileFilenamePattern { get; set; }
public OutputFormats OutputFileFormat { get; set; }
public bool OutputFileReduceColors { get; set; }
public bool OutputFileAutoReduceColors { get; set; }
public int OutputFileReduceColorsTo { get; set; }
public int OutputFileJpegQuality { get; set; }
public bool OutputFilePromptQuality { get; set; }
public uint OutputFileIncrementingNumber { get; set; }
public string OptimizePNGCommand { get; set; }
public string OptimizePNGCommandArguments { get; set; }
#endregion
#region Implementation of IDestinationFileConfiguration
public bool UseOwnSettings { get; set; }
#endregion
#region Implementation of ILutimConfiguration
public string LutimUrl { get; set; }
public bool CopyLinkToClipboard { get; set; }
public IDictionary<string, string> LutimUploadHistory { get; set; }
public IDictionary<string, LutimInfo> RuntimeLutimHistory { get; set; }
#endregion
}
}

View file

@ -0,0 +1,52 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Language;
namespace Greenshot.Addon.Lutim.Configuration.Impl
{
public class LutimLanguageImpl : LanguageBase<ILutimLanguage>, ILutimLanguage
{
#region Implementation of ILutimLanguage
public string Cancel { get; }
public string ClearQuestion { get; }
public string CommunicationWait { get; }
public string Configure { get; }
public string DeleteQuestion { get; }
public string DeleteTitle { get; }
public string History { get; }
public string LabelClear { get; }
public string LabelUploadFormat { get; }
public string LabelUrl { get; }
public string Ok { get; }
public string SettingsTitle { get; }
public string UploadFailure { get; }
public string UploadMenuItem { get; }
public string UploadSuccess { get; }
public string UsePageLink { get; }
public string AnonymousAccess { get; }
#endregion
}
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<AutoProperties />
</Weavers>

View file

@ -1,42 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<Project Sdk="Microsoft.NET.Sdk.Wpf">
<PropertyGroup>
<ProjectGuid>{D106F86C-CD3D-44FF-B151-2A5D47268B5C}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Greenshot.Addon.Lutim</RootNamespace>
<AssemblyName>Greenshot.Addon.Lutim</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
@ -57,101 +37,28 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Entities\AddResult.cs" />
<Compile Include="Entities\LutimInfo.cs" />
<Compile Include="LutimAddonModule.cs" />
<Compile Include="ILutimLanguage.cs" />
<Compile Include="LutimDestination.cs" />
<Compile Include="ILutimConfiguration.cs" />
<Compile Include="LutimApi.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\LutimConfigViewModel.cs" />
<Compile Include="ViewModels\LutimHistoryViewModel.cs" />
<None Include="app.config" />
<None Include="Languages\language_lutimplugin-de-DE.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_lutimplugin-en-US.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_lutimplugin-fr-FR.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_lutimplugin-nl-NL.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_lutimplugin-zh-CN.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Lutim.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
<Name>Greenshot.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj">
<Project>{f041c685-eb96-4ed1-9ace-0f5bd836610f}</Project>
<Name>Greenshot.Gfx</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj">
<Project>{5b924697-4dcd-4f98-85f1-105cb84b7341}</Project>
<Name>Greenshot.Addons</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="Languages\language_lutimplugin-cs-CZ.xml" />
<Content Include="Languages\language_lutimplugin-id-ID.xml" />
<Content Include="Languages\language_lutimplugin-it-IT.xml" />
<Content Include="Languages\language_lutimplugin-ko-KR.xml" />
<Content Include="Languages\language_lutimplugin-lv-LV.xml" />
<Content Include="Languages\language_lutimplugin-pl-PL.xml" />
<Content Include="Languages\language_lutimplugin-pt-PT.xml" />
<Content Include="Languages\language_lutimplugin-ru-RU.xml" />
<Content Include="Languages\language_lutimplugin-sk-SK.xml" />
<Content Include="Languages\language_lutimplugin-sr-RS.xml" />
<Content Include="Languages\language_lutimplugin-sv-SE.xml" />
<Content Include="Languages\language_lutimplugin-uk-UA.xml" />
<Content Include="Languages\language_lutimplugin-zh-TW.xml" />
</ItemGroup>
<ItemGroup>
<Page Include="Views\LutimConfigView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\LutimHistoryView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.HttpExtensions.JsonNet">
<Version>0.8.46</Version>
</PackageReference>
<PackageReference Include="Dapplo.Windows.Clipboard">
<Version>0.5.112</Version>
</PackageReference>
<PackageReference Include="MahApps.Metro">
<Version>1.6.5</Version>
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.11" />
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.11" />
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.19" />
<PackageReference Include="MahApps.Metro" Version="1.6.5" />
<PackageReference Include="Fody" Version="3.2.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
</PropertyGroup>
</Project>

View file

@ -24,8 +24,10 @@
using Autofac;
using Dapplo.Addons;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.Ini;
using Dapplo.Language;
using Dapplo.Config.Ini;
using Dapplo.Config.Language;
using Greenshot.Addon.Lutim.Configuration;
using Greenshot.Addon.Lutim.Configuration.Impl;
using Greenshot.Addon.Lutim.ViewModels;
using Greenshot.Addons.Components;
@ -37,13 +39,15 @@ namespace Greenshot.Addon.Lutim
protected override void Load(ContainerBuilder builder)
{
builder
.Register(context => IniConfig.Current.Get<ILutimConfiguration>())
.RegisterType<LutimConfigurationImpl>()
.As<ILutimConfiguration>()
.As<IIniSection>()
.SingleInstance();
builder
.Register(context => LanguageLoader.Current.Get<ILutimLanguage>())
.RegisterType<LutimLanguageImpl>()
.As<ILutimLanguage>()
.As<ILanguage>()
.SingleInstance();
builder

View file

@ -27,6 +27,7 @@ using System.Threading;
using System.Threading.Tasks;
using Dapplo.HttpExtensions;
using Dapplo.Log;
using Greenshot.Addon.Lutim.Configuration;
using Greenshot.Addon.Lutim.Entities;
using Greenshot.Addons.Core;
using Greenshot.Addons.Interfaces;

View file

@ -28,6 +28,7 @@ using Autofac.Features.OwnedInstances;
using Dapplo.Addons;
using Dapplo.Log;
using Dapplo.Windows.Clipboard;
using Greenshot.Addon.Lutim.Configuration;
using Greenshot.Addon.Lutim.Entities;
using Greenshot.Addons;
using Greenshot.Addons.Components;

View file

@ -1,44 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot.Addon.Lutim")]
[assembly: AssemblyDescription("A plugin to upload images to Lutim")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot")]
[assembly: AssemblyProduct("Lutim Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2007-2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version, replaced by build scripts
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

View file

@ -24,6 +24,7 @@
using System.Reactive.Disposables;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.CaliburnMicro.Extensions;
using Greenshot.Addon.Lutim.Configuration;
using Greenshot.Addons.Core.Enums;
using Greenshot.Addons.ViewModels;

View file

@ -31,6 +31,7 @@ using Caliburn.Micro;
using Dapplo.CaliburnMicro.Extensions;
using Dapplo.Log;
using Dapplo.Windows.Clipboard;
using Greenshot.Addon.Lutim.Configuration;
using Greenshot.Addon.Lutim.Entities;
using Greenshot.Addons;
using Greenshot.Addons.Extensions;

View file

@ -24,7 +24,7 @@
#region Usings
using System.ComponentModel;
using Dapplo.Ini;
using Dapplo.Config.Ini;
#endregion
@ -35,7 +35,7 @@ namespace Greenshot.Addon.OCR
/// </summary>
[IniSection("OCR")]
[Description("Greenshot OCR Plugin configuration")]
public interface IOCRConfiguration : IIniSection<IOCRConfiguration>
public interface IOcrConfiguration : IIniSection
{
[Description("Language for OCR")]
[DefaultValue ("miLANG_ENGLISH")]

View file

@ -18,7 +18,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System.ComponentModel;
using Dapplo.Language;
using Dapplo.Config.Language;
namespace Greenshot.Addon.OCR
{

View file

@ -0,0 +1,38 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Ini;
namespace Greenshot.Addon.OCR.Configuration.Impl
{
public class OcrConfigurationImpl : IniSectionBase<IOcrConfiguration>, IOcrConfiguration
{
#region Implementation of IOcrConfiguration
public string Language { get; set; }
public bool Orientimage { get; set; }
public bool StraightenImage { get; set; }
#endregion
}
}

View file

@ -1,4 +1,4 @@
#region Greenshot GNU General Public License
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
@ -21,12 +21,18 @@
#endregion
namespace Greenshot.Addon.Office.OfficeInterop
using Dapplo.Config.Language;
namespace Greenshot.Addon.OCR.Configuration.Impl
{
public enum MsoScaleFrom
public class OcrLanguageImpl : LanguageBase<IOcrLanguage>, IOcrLanguage
{
msoScaleFromTopLeft = 0,
msoScaleFromMiddle = 1,
msoScaleFromBottomRight = 2
#region Implementation of IOcrLanguage
public string Language { get; }
public string OrientImage { get; }
public string StraightenImage { get; }
#endregion
}
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<AutoProperties />
</Weavers>

View file

@ -1,43 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<Project Sdk="Microsoft.NET.Sdk.Wpf">
<PropertyGroup>
<ProjectGuid>{C6988EE8-2FEE-4349-9F09-F9628A0D8965}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Greenshot.Addon.OCR</RootNamespace>
<AssemblyName>Greenshot.Addon.OCR</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@ -50,97 +30,24 @@
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="IOcrLanguage.cs" />
<Compile Include="ModiLanguage.cs" />
<Compile Include="IOCRConfiguration.cs" />
<Compile Include="OcrDestination.cs" />
<Compile Include="OcrAddonModule.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
<None Include="app.config" />
<None Include="Languages\language_ocrplugin-de-DE.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Languages\language_ocrplugin-en-US.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Languages\language_ocrplugin-fr-FR.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Languages\language_ocrplugin-nl-NL.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Languages\language_ocrplugin-zh-CN.xml" />
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
<Name>Greenshot.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj">
<Project>{f041c685-eb96-4ed1-9ace-0f5bd836610f}</Project>
<Name>Greenshot.Gfx</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>Greenshot.Addons</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.Windows.Clipboard">
<Version>0.5.112</Version>
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.19" />
<PackageReference Include="Fody" Version="3.2.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>x86</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>None</DebugType>
<DebugSymbols>false</DebugSymbols>
<DefineConstants>TRACE</DefineConstants>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup>
</Project>

View file

@ -51,11 +51,11 @@ namespace Greenshot.Addon.OCR
private static readonly LogSource Log = new LogSource();
private const int MinWidth = 130;
private const int MinHeight = 130;
private readonly IOCRConfiguration _ocrConfiguration;
private readonly IOcrConfiguration _ocrConfiguration;
private readonly string _ocrCommand;
public OcrDestination(
IOCRConfiguration ocrConfiguration,
IOcrConfiguration ocrConfiguration,
ICoreConfiguration coreConfiguration,
IGreenshotLanguage greenshotLanguage,
ExportNotification exportNotification

View file

@ -26,8 +26,9 @@ using System.IO;
using Autofac;
using Dapplo.Addons;
using Dapplo.Addons.Bootstrapper.Resolving;
using Dapplo.Ini;
using Dapplo.Language;
using Dapplo.Config.Ini;
using Dapplo.Config.Language;
using Greenshot.Addon.OCR.Configuration.Impl;
using Greenshot.Addons.Components;
namespace Greenshot.Addon.OCR
@ -63,13 +64,15 @@ namespace Greenshot.Addon.OCR
if (HasModi())
{
builder
.Register(context => IniConfig.Current.Get<IOCRConfiguration>())
.As<IOCRConfiguration>()
.RegisterType<OcrConfigurationImpl>()
.As<IOcrConfiguration>()
.As<IIniSection>()
.SingleInstance();
builder
.Register(context => LanguageLoader.Current.Get<IOcrLanguage>())
.RegisterType<OcrLanguageImpl>()
.As<IOcrLanguage>()
.As<ILanguage>()
.SingleInstance();
builder

View file

@ -1,53 +0,0 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
#region Usings
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot.Addon.OCR")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot")]
[assembly: AssemblyProduct("OCR Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2007-2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version, replaced by build scripts
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

View file

@ -35,9 +35,9 @@ namespace Greenshot.Addon.OCR
/// </summary>
public partial class SettingsForm : GreenshotForm
{
private readonly IOCRConfiguration config;
private readonly IOcrConfiguration config;
public SettingsForm(string[] languages, IOcrLanguage ocrLanguage, IOCRConfiguration config) : base(ocrLanguage)
public SettingsForm(string[] languages, IOcrLanguage ocrLanguage, IOcrConfiguration config) : base(ocrLanguage)
{
//
// The InitializeComponent() call is required for Windows Forms designer support.

View file

@ -24,21 +24,20 @@
#region Usings
using System.ComponentModel;
using Dapplo.Ini;
using Dapplo.InterfaceImpl.Extensions;
using Dapplo.Config.Ini;
using Greenshot.Addon.Office.OfficeInterop;
using Microsoft.Office.Interop.PowerPoint;
#endregion
namespace Greenshot.Addon.Office
namespace Greenshot.Addon.Office.Configuration
{
/// <summary>
/// Office configuration
/// </summary>
[IniSection("Office")]
[Description("Greenshot Office configuration")]
public interface IOfficeConfiguration : IIniSection, ITransactionalProperties, INotifyPropertyChanged
public interface IOfficeConfiguration : IIniSection
{
[Description("Default type for emails. (Text, Html)")]
[DefaultValue(EmailFormat.Html)]

View file

@ -18,9 +18,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System.ComponentModel;
using Dapplo.Language;
using Dapplo.Config.Language;
namespace Greenshot.Addon.Office
namespace Greenshot.Addon.Office.Configuration
{
[Language("Office")]
public interface IOfficeLanguage : ILanguage, INotifyPropertyChanged

View file

@ -0,0 +1,23 @@
using Dapplo.Config.Ini;
using Greenshot.Addon.Office.OfficeInterop;
using Microsoft.Office.Interop.PowerPoint;
namespace Greenshot.Addon.Office.Configuration.Impl
{
public class OfficeConfigurationImpl : IniSectionBase<IOfficeConfiguration>, IOfficeConfiguration
{
#region Implementation of IOfficeConfiguration
public EmailFormat OutlookEmailFormat { get; set; }
public string EmailSubjectPattern { get; set; }
public string EmailTo { get; set; }
public string EmailCC { get; set; }
public string EmailBCC { get; set; }
public bool OutlookAllowExportInMeetings { get; set; }
public bool WordLockAspectRatio { get; set; }
public bool PowerpointLockAspectRatio { get; set; }
public PpSlideLayout PowerpointSlideLayout { get; set; }
#endregion
}
}

View file

@ -0,0 +1,46 @@
#region Greenshot GNU General Public License
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using Dapplo.Config.Language;
namespace Greenshot.Addon.Office.Configuration.Impl
{
public class OfficeLanguageImpl : LanguageBase<IOfficeLanguage>, IOfficeLanguage
{
#region Implementation of IOfficeLanguage
public string SettingsTitle { get; }
public string WordLockaspect { get; }
public string OutlookAllowmeetings { get; }
public string OutlookSubjectPattern { get; }
public string OutlookEmailFormat { get; }
public string OutlookEmailIncludeSignature { get; }
public string OutlookEmailTo { get; }
public string OutlookEmailCc { get; }
public string OutlookEmailBcc { get; }
public string PowerpointSlideLayout { get; }
public string PowerpointLockaspect { get; }
#endregion
}
}

View file

@ -29,12 +29,14 @@ using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Dapplo.Log;
using Greenshot.Addon.Office.Configuration;
using Greenshot.Addon.Office.OfficeExport;
using Greenshot.Addons;
using Greenshot.Addons.Components;
using Greenshot.Addons.Core;
using Greenshot.Addons.Interfaces;
using Greenshot.Addons.Interfaces.Plugin;
using Greenshot.Addons.Resources;
using Microsoft.Office.Interop.Outlook;
#endregion
@ -54,11 +56,12 @@ namespace Greenshot.Addon.Office.Destinations
private readonly IOfficeConfiguration _officeConfiguration;
private readonly ExportNotification _exportNotification;
private static readonly Bitmap MailIcon = GreenshotResources.GetBitmap("Email.Image");
private static readonly Bitmap MailIcon = GreenshotResources.Instance.GetBitmap("Email.Image");
private readonly string _exePath;
private readonly bool _isActiveFlag;
private readonly string _outlookInspectorCaption;
private readonly OlObjectClass _outlookInspectorType;
private readonly OutlookExporter _outlookExporter;
public OutlookDestination(
IOfficeConfiguration officeConfiguration,
@ -68,6 +71,7 @@ namespace Greenshot.Addon.Office.Destinations
) : base(coreConfiguration, greenshotLanguage)
{
_officeConfiguration = officeConfiguration;
_outlookExporter = new OutlookExporter(officeConfiguration);
_exportNotification = exportNotification;
if (EmailConfigHelper.HasOutlook())
{
@ -121,7 +125,7 @@ namespace Greenshot.Addon.Office.Destinations
public override IEnumerable<IDestination> DynamicDestinations()
{
var inspectorCaptions = OutlookExporter.RetrievePossibleTargets();
var inspectorCaptions = _outlookExporter.RetrievePossibleTargets();
if (inspectorCaptions == null)
{
yield break;
@ -169,14 +173,14 @@ namespace Greenshot.Addon.Office.Destinations
if (_outlookInspectorCaption != null)
{
OutlookExporter.ExportToInspector(_outlookInspectorCaption, tmpFile, attachmentName);
_outlookExporter.ExportToInspector(_outlookInspectorCaption, tmpFile, attachmentName);
exportInformation.ExportMade = true;
}
else
{
if (!manuallyInitiated)
{
var inspectorCaptions = OutlookExporter.RetrievePossibleTargets();
var inspectorCaptions = _outlookExporter.RetrievePossibleTargets();
if (inspectorCaptions != null && inspectorCaptions.Count > 0)
{
var destinations = new List<IDestination>
@ -193,7 +197,7 @@ namespace Greenshot.Addon.Office.Destinations
}
else
{
exportInformation.ExportMade = OutlookExporter.ExportToOutlook(_officeConfiguration.OutlookEmailFormat, tmpFile,
exportInformation.ExportMade = _outlookExporter.ExportToOutlook(_officeConfiguration.OutlookEmailFormat, tmpFile,
FilenameHelper.FillPattern(_officeConfiguration.EmailSubjectPattern, captureDetails, false), attachmentName, _officeConfiguration.EmailTo, _officeConfiguration.EmailCC,
_officeConfiguration.EmailBCC, null);
}

View file

@ -28,6 +28,7 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Greenshot.Addon.Office.Configuration;
using Greenshot.Addon.Office.OfficeExport;
using Greenshot.Addons;
using Greenshot.Addons.Components;
@ -45,21 +46,26 @@ namespace Greenshot.Addon.Office.Destinations
[Destination("Powerpoint", DestinationOrder.Powerpoint)]
public class PowerpointDestination : AbstractDestination
{
private readonly IOfficeConfiguration _officeConfiguration;
private readonly ExportNotification _exportNotification;
private const int IconApplication = 0;
private const int IconPresentation = 1;
private readonly string _exePath;
private readonly string _presentationName;
private readonly PowerpointExporter _powerpointExporter;
private const int IconApplication = 0;
private const int IconPresentation = 1;
public PowerpointDestination(
ICoreConfiguration coreConfiguration,
IGreenshotLanguage greenshotLanguage,
IOfficeConfiguration officeConfiguration,
ExportNotification exportNotification
) : base(coreConfiguration, greenshotLanguage)
{
_officeConfiguration = officeConfiguration;
_exportNotification = exportNotification;
_powerpointExporter = new PowerpointExporter(officeConfiguration);
_exePath = PluginUtils.GetExePath("POWERPNT.EXE");
if (_exePath != null && !File.Exists(_exePath))
{
@ -70,7 +76,8 @@ namespace Greenshot.Addon.Office.Destinations
public PowerpointDestination(string presentationName,
ICoreConfiguration coreConfiguration,
IGreenshotLanguage greenshotLanguage,
ExportNotification exportNotification) : this(coreConfiguration, greenshotLanguage, exportNotification)
IOfficeConfiguration officeConfiguration,
ExportNotification exportNotification) : this(coreConfiguration, greenshotLanguage, officeConfiguration, exportNotification)
{
_presentationName = presentationName;
}
@ -103,7 +110,7 @@ namespace Greenshot.Addon.Office.Destinations
public override IEnumerable<IDestination> DynamicDestinations()
{
return PowerpointExporter.GetPowerpointPresentations().Select(presentationName => new PowerpointDestination(presentationName, CoreConfiguration, GreenshotLanguage, _exportNotification));
return _powerpointExporter.GetPowerpointPresentations().Select(presentationName => new PowerpointDestination(presentationName, CoreConfiguration, GreenshotLanguage, _officeConfiguration, _exportNotification));
}
protected override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails)
@ -118,22 +125,22 @@ namespace Greenshot.Addon.Office.Destinations
}
if (_presentationName != null)
{
exportInformation.ExportMade = PowerpointExporter.ExportToPresentation(_presentationName, tmpFile, imageSize, captureDetails.Title);
exportInformation.ExportMade = _powerpointExporter.ExportToPresentation(_presentationName, tmpFile, imageSize, captureDetails.Title);
}
else
{
if (!manuallyInitiated)
{
var presentations = PowerpointExporter.GetPowerpointPresentations().ToList();
var presentations = _powerpointExporter.GetPowerpointPresentations().ToList();
if (presentations.Count > 0)
{
var destinations = new List<IDestination>
{
new PowerpointDestination(CoreConfiguration, GreenshotLanguage, _exportNotification)
new PowerpointDestination(CoreConfiguration, GreenshotLanguage, _officeConfiguration, _exportNotification)
};
foreach (var presentation in presentations)
{
destinations.Add(new PowerpointDestination(presentation, CoreConfiguration, GreenshotLanguage, _exportNotification));
destinations.Add(new PowerpointDestination(presentation, CoreConfiguration, GreenshotLanguage, _officeConfiguration, _exportNotification));
}
// Return the ExportInformation from the picker without processing, as this indirectly comes from us self
return ShowPickerMenu(false, surface, captureDetails, destinations);
@ -141,7 +148,7 @@ namespace Greenshot.Addon.Office.Destinations
}
else if (!exportInformation.ExportMade)
{
exportInformation.ExportMade = PowerpointExporter.InsertIntoNewPresentation(tmpFile, imageSize, captureDetails.Title);
exportInformation.ExportMade = _powerpointExporter.InsertIntoNewPresentation(tmpFile, imageSize, captureDetails.Title);
}
}
_exportNotification.NotifyOfExport(this, exportInformation, surface);

View file

@ -30,6 +30,7 @@ using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Dapplo.Log;
using Greenshot.Addon.Office.Configuration;
using Greenshot.Addon.Office.OfficeExport;
using Greenshot.Addons;
using Greenshot.Addons.Components;
@ -47,20 +48,25 @@ namespace Greenshot.Addon.Office.Destinations
[Destination("Word", DestinationOrder.Word)]
public class WordDestination : AbstractDestination
{
private readonly IOfficeConfiguration _officeConfiguration;
private readonly ExportNotification _exportNotification;
private const int IconApplication = 0;
private const int IconDocument = 1;
private static readonly LogSource Log = new LogSource();
private readonly string _exePath;
private readonly string _documentCaption;
private readonly WordExporter _wordExporter;
public WordDestination(
ICoreConfiguration coreConfiguration,
IGreenshotLanguage greenshotLanguage,
IOfficeConfiguration officeConfiguration,
ExportNotification exportNotification
) : base(coreConfiguration, greenshotLanguage)
{
_officeConfiguration = officeConfiguration;
_exportNotification = exportNotification;
_wordExporter = new WordExporter(officeConfiguration);
_exePath = PluginUtils.GetExePath("WINWORD.EXE");
if (_exePath != null && !File.Exists(_exePath))
{
@ -71,7 +77,8 @@ namespace Greenshot.Addon.Office.Destinations
protected WordDestination(string wordCaption,
ICoreConfiguration coreConfiguration,
IGreenshotLanguage greenshotLanguage,
ExportNotification exportNotification) : this(coreConfiguration, greenshotLanguage, exportNotification)
IOfficeConfiguration officeConfiguration,
ExportNotification exportNotification) : this(coreConfiguration, greenshotLanguage, officeConfiguration, exportNotification)
{
_documentCaption = wordCaption;
}
@ -89,7 +96,7 @@ namespace Greenshot.Addon.Office.Destinations
public override IEnumerable<IDestination> DynamicDestinations()
{
return WordExporter.GetWordDocuments().Select(wordCaption => new WordDestination(wordCaption, CoreConfiguration, GreenshotLanguage, _exportNotification));
return _wordExporter.GetWordDocuments().Select(wordCaption => new WordDestination(wordCaption, CoreConfiguration, GreenshotLanguage, _officeConfiguration, _exportNotification));
}
protected override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails)
@ -104,14 +111,14 @@ namespace Greenshot.Addon.Office.Destinations
{
try
{
WordExporter.InsertIntoExistingDocument(_documentCaption, tmpFile);
_wordExporter.InsertIntoExistingDocument(_documentCaption, tmpFile);
exportInformation.ExportMade = true;
}
catch (Exception)
{
try
{
WordExporter.InsertIntoExistingDocument(_documentCaption, tmpFile);
_wordExporter.InsertIntoExistingDocument(_documentCaption, tmpFile);
exportInformation.ExportMade = true;
}
catch (Exception ex)
@ -126,16 +133,16 @@ namespace Greenshot.Addon.Office.Destinations
{
if (!manuallyInitiated)
{
var documents = WordExporter.GetWordDocuments().ToList();
var documents = _wordExporter.GetWordDocuments().ToList();
if (documents.Count > 0)
{
var destinations = new List<IDestination>
{
new WordDestination(CoreConfiguration, GreenshotLanguage, _exportNotification)
new WordDestination(CoreConfiguration, GreenshotLanguage, _officeConfiguration, _exportNotification)
};
foreach (var document in documents)
{
destinations.Add(new WordDestination(document, CoreConfiguration, GreenshotLanguage, _exportNotification));
destinations.Add(new WordDestination(document, CoreConfiguration, GreenshotLanguage, _officeConfiguration, _exportNotification));
}
// Return the ExportInformation from the picker without processing, as this indirectly comes from us self
return ShowPickerMenu(false, surface, captureDetails, destinations);
@ -143,7 +150,7 @@ namespace Greenshot.Addon.Office.Destinations
}
try
{
WordExporter.InsertIntoNewDocument(tmpFile, null, null);
_wordExporter.InsertIntoNewDocument(tmpFile, null, null);
exportInformation.ExportMade = true;
}
catch (Exception)
@ -151,7 +158,7 @@ namespace Greenshot.Addon.Office.Destinations
// Retry once, just in case
try
{
WordExporter.InsertIntoNewDocument(tmpFile, null, null);
_wordExporter.InsertIntoNewDocument(tmpFile, null, null);
exportInformation.ExportMade = true;
}
catch (Exception ex)

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<AutoProperties />
</Weavers>

View file

@ -1,26 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="..\CommonProject.properties" />
<Project Sdk="Microsoft.NET.Sdk.Wpf">
<PropertyGroup>
<ProjectGuid>{92599C09-FF29-4ABD-B6E6-C48ECD781BAB}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>Library</OutputType>
<RootNamespace>Greenshot.Addon.Office</RootNamespace>
<AssemblyName>Greenshot.Addon.Office</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<TargetFrameworks>net471</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
@ -40,82 +36,27 @@
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Destinations\OutlookDestination.cs" />
<Compile Include="Destinations\ExcelDestination.cs" />
<Compile Include="Destinations\OneNoteDestination.cs" />
<Compile Include="Destinations\PowerpointDestination.cs" />
<Compile Include="Destinations\WordDestination.cs" />
<Compile Include="IOfficeLanguage.cs" />
<Compile Include="IOfficeConfiguration.cs" />
<Compile Include="OfficeInterop\EmailFormat.cs" />
<Compile Include="OfficeInterop\OfficeVersions.cs" />
<Compile Include="OfficeAddonModule.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="OfficeExport\ExcelExporter.cs" />
<Compile Include="OfficeExport\OneNoteExporter.cs" />
<Compile Include="OfficeExport\OutlookEmailExporter.cs" />
<Compile Include="OfficeExport\PowerpointExporter.cs" />
<Compile Include="OfficeExport\WordExporter.cs" />
<Compile Include="ViewModels\OfficeConfigViewModel.cs" />
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>Greenshot.Addons</Name>
</ProjectReference>
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj">
<Project>{bf35190d-b2a7-4cfa-b397-51cb384cf0d7}</Project>
<Name>Greenshot.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<Page Include="Views\OfficeConfigView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
<Version>1.0.75</Version>
</PackageReference>
<PackageReference Include="Dapplo.Windows.Clipboard">
<Version>0.5.112</Version>
</PackageReference>
<PackageReference Include="Interop.Microsoft.Office.Interop.OneNote">
<Version>1.1.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Office.Interop.Excel">
<Version>15.0.4795.1000</Version>
</PackageReference>
<PackageReference Include="Microsoft.Office.Interop.Outlook">
<Version>15.0.4797.1003</Version>
</PackageReference>
<PackageReference Include="Microsoft.Office.Interop.PowerPoint">
<Version>15.0.4420.1017</Version>
</PackageReference>
<PackageReference Include="Microsoft.Office.Interop.Word">
<Version>15.0.4797.1003</Version>
</PackageReference>
<PackageReference Include="MicrosoftOfficeCore">
<Version>15.0.0</Version>
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.1.11-gd26115c7d3" />
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.19" />
<PackageReference Include="Interop.Microsoft.Office.Interop.OneNote" Version="1.1.0" />
<PackageReference Include="Microsoft.Office.Interop.Excel" Version="15.0.4795.1000" />
<PackageReference Include="Microsoft.Office.Interop.Outlook" Version="15.0.4797.1003" />
<PackageReference Include="Microsoft.Office.Interop.PowerPoint" Version="15.0.4420.1017" />
<PackageReference Include="Microsoft.Office.Interop.Word" Version="15.0.4797.1003" />
<PackageReference Include="MicrosoftOfficeCore" Version="15.0.0" />
<PackageReference Include="Fody" Version="3.2.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Addons\"
mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\$(ProjectName)"</PostBuildEvent>
</PropertyGroup>
</Project>

View file

@ -24,8 +24,10 @@
using Autofac;
using Dapplo.Addons;
using Dapplo.CaliburnMicro.Configuration;
using Dapplo.Ini;
using Dapplo.Language;
using Dapplo.Config.Ini;
using Dapplo.Config.Language;
using Greenshot.Addon.Office.Configuration;
using Greenshot.Addon.Office.Configuration.Impl;
using Greenshot.Addon.Office.Destinations;
using Greenshot.Addon.Office.ViewModels;
using Greenshot.Addons.Components;
@ -88,14 +90,16 @@ namespace Greenshot.Addon.Office
if (hasDestination)
{
builder
.Register(context => IniConfig.Current.Get<IOfficeConfiguration>())
.RegisterType<OfficeConfigurationImpl>()
.As<IOfficeConfiguration>()
.As<IIniSection>()
.SingleInstance();
builder
.Register(context => LanguageLoader.Current.Get<IOfficeLanguage>())
.RegisterType<OfficeLanguageImpl>()
.As<IOfficeLanguage>()
.As<ILanguage>()
.SingleInstance();
builder

Some files were not shown because too many files have changed in this diff Show more