mirror of
https://github.com/greenshot/greenshot
synced 2025-08-23 06:36:20 -07:00
Making it possible to compile the first projects [skip ci]
This commit is contained in:
parent
8fad00b38f
commit
c4b686e96c
34 changed files with 244 additions and 441 deletions
|
@ -9,10 +9,12 @@
|
||||||
<PackageLicenseUrl>https://www.gnu.org/licenses/gpl.html</PackageLicenseUrl>
|
<PackageLicenseUrl>https://www.gnu.org/licenses/gpl.html</PackageLicenseUrl>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
<DisableImplicitFrameworkReferences Condition="'$(TargetFramework)' == 'net461'">true</DisableImplicitFrameworkReferences>
|
<!-- <DisableImplicitFrameworkReferences Condition="'$(TargetFramework)' == 'net471'">true</DisableImplicitFrameworkReferences> -->
|
||||||
|
<CopyLocalLockFileAssemblies Condition="'$(TargetFramework)' != 'net471'">true</CopyLocalLockFileAssemblies>
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
<AssemblyVersion>1.0.0</AssemblyVersion>
|
<AssemblyVersion>1.0.0</AssemblyVersion>
|
||||||
<FileVersion>1.0.0</FileVersion>
|
<FileVersion>1.0.0</FileVersion>
|
||||||
|
<AssemblySearchPaths Condition="'$(TargetFramework)' == 'net471'">{HintPathFromItem};{TargetFrameworkDirectory};{RawFileName};</AssemblySearchPaths>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)' != 'Debug' And !$(MSBuildProjectName.Contains('Test')) And !$(MSBuildProjectName.Contains('Demo'))">
|
<PropertyGroup Condition="'$(Configuration)' != 'Debug' And !$(MSBuildProjectName.Contains('Test')) And !$(MSBuildProjectName.Contains('Demo'))">
|
||||||
|
@ -41,7 +43,7 @@
|
||||||
<DebugSymbols>True</DebugSymbols>
|
<DebugSymbols>True</DebugSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
|
||||||
<!--ApplicationDefinition Include="App.xaml">
|
<!--ApplicationDefinition Include="App.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#if !NETCOREAPP30
|
|
||||||
#region Usings
|
#region Usings
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@ -335,7 +334,7 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
OBJID_WINDOW = 0x00000000
|
OBJID_WINDOW = 0x00000000
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Interop
|
#region Interop
|
||||||
|
|
||||||
private static int AccessibleObjectFromWindow(IntPtr hWnd, OBJID idObject, ref IAccessible acc)
|
private static int AccessibleObjectFromWindow(IntPtr hWnd, OBJID idObject, ref IAccessible acc)
|
||||||
{
|
{
|
||||||
|
@ -357,7 +356,6 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
[return: MarshalAs(UnmanagedType.Interface)]
|
[return: MarshalAs(UnmanagedType.Interface)]
|
||||||
public static extern object ObjectFromLresult(UIntPtr lResult, [MarshalAs(UnmanagedType.LPStruct)] Guid refiid, IntPtr wParam);
|
public static extern object ObjectFromLresult(UIntPtr lResult, [MarshalAs(UnmanagedType.LPStruct)] Guid refiid, IntPtr wParam);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
|
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
<FrameworkReference Include="Microsoft.DesktopUI" />
|
<FrameworkReference Include="Microsoft.DesktopUI" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461' ">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net471' ">
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.VisualBasic" />
|
<Reference Include="Microsoft.VisualBasic" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -34,10 +34,10 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapplo.Windows">
|
<PackageReference Include="Dapplo.Windows">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Com">
|
<PackageReference Include="Dapplo.Windows.Com">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Unofficial.Microsoft.mshtml" Version="7.0.3300" />
|
<PackageReference Include="Unofficial.Microsoft.mshtml" Version="7.0.3300" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -108,14 +108,18 @@ namespace Greenshot.Addon.InternetExplorer {
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#if !NETCOREAPP30
|
#if !NETCOREAPP3_0
|
||||||
var ieAccessible = new Accessible(directUiWd.Handle);
|
var ieAccessible = new Accessible(directUiWd.Handle);
|
||||||
foreach (var url in ieAccessible.IETabUrls)
|
foreach (var url in ieAccessible.IETabUrls)
|
||||||
{
|
{
|
||||||
yield return url;
|
yield return url;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#if NETCOREAPP3_0
|
||||||
|
return Enumerable.Empty<string>();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
|
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
<FrameworkReference Include="Microsoft.DesktopUI" />
|
<FrameworkReference Include="Microsoft.DesktopUI" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461' ">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net471' ">
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.VisualBasic" />
|
<Reference Include="Microsoft.VisualBasic" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -51,19 +51,19 @@
|
||||||
<Version>2.0.4</Version>
|
<Version>2.0.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.HttpExtensions">
|
<PackageReference Include="Dapplo.HttpExtensions">
|
||||||
<Version>0.9.6</Version>
|
<Version>0.9.6</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard">
|
<PackageReference Include="Dapplo.Windows.Clipboard">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Icons">
|
<PackageReference Include="Dapplo.Windows.Icons">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -41,7 +41,7 @@ namespace Greenshot.Addons.Controls
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AnimatingForm : GreenshotForm
|
public class AnimatingForm : GreenshotForm
|
||||||
{
|
{
|
||||||
private readonly ICoreConfiguration _coreConfiguration;
|
protected readonly ICoreConfiguration _coreConfiguration;
|
||||||
private const int DefaultVerticalRefresh = 60;
|
private const int DefaultVerticalRefresh = 60;
|
||||||
private static readonly LogSource Log = new LogSource();
|
private static readonly LogSource Log = new LogSource();
|
||||||
private Timer _timer;
|
private Timer _timer;
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using Dapplo.Windows.Common.Structs;
|
||||||
using Greenshot.Addons.Config.Impl;
|
using Greenshot.Addons.Config.Impl;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
using Greenshot.Gfx;
|
using Greenshot.Gfx;
|
||||||
|
@ -45,7 +46,7 @@ namespace Greenshot.Addons.Controls
|
||||||
private bool _newImage;
|
private bool _newImage;
|
||||||
protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e)
|
protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e)
|
||||||
{
|
{
|
||||||
if (_scaledCheckbox == null || _scaledCheckbox.Size != CoreConfig.IconSize)
|
if (_scaledCheckbox == null || (NativeSize)_scaledCheckbox.Size != CoreConfig.IconSize)
|
||||||
{
|
{
|
||||||
if (_newImage)
|
if (_newImage)
|
||||||
{
|
{
|
||||||
|
|
|
@ -192,11 +192,11 @@ EndSelection:<<<<<<<4
|
||||||
var clipboardOwner = GetClipboardOwner();
|
var clipboardOwner = GetClipboardOwner();
|
||||||
if (clipboardOwner != null)
|
if (clipboardOwner != null)
|
||||||
{
|
{
|
||||||
messageText = Language.GetFormattedString("clipboard_inuse", clipboardOwner);
|
messageText = "in use"; // Language.GetFormattedString("clipboard_inuse", clipboardOwner);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
messageText = Language.GetString("Core","clipboard_error");
|
messageText = "error"; // Language.GetString("Core","clipboard_error");
|
||||||
}
|
}
|
||||||
Log.Error().WriteLine(clipboardSetException, messageText);
|
Log.Error().WriteLine(clipboardSetException, messageText);
|
||||||
}
|
}
|
||||||
|
@ -223,13 +223,14 @@ EndSelection:<<<<<<<4
|
||||||
{
|
{
|
||||||
string messageText;
|
string messageText;
|
||||||
var clipboardOwner = GetClipboardOwner();
|
var clipboardOwner = GetClipboardOwner();
|
||||||
|
// TODO: Translations
|
||||||
if (clipboardOwner != null)
|
if (clipboardOwner != null)
|
||||||
{
|
{
|
||||||
messageText = Language.GetFormattedString("clipboard_inuse", clipboardOwner);
|
messageText = "In use"; // Language.GetFormattedString("clipboard_inuse", clipboardOwner);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
messageText = Language.GetString("Core", "clipboard_error");
|
messageText = "Error"; // Language.GetString("Core", "clipboard_error");
|
||||||
}
|
}
|
||||||
Log.Error().WriteLine(ee, messageText);
|
Log.Error().WriteLine(ee, messageText);
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,9 @@ namespace Greenshot.Addons.Core
|
||||||
}
|
}
|
||||||
catch (ExternalException)
|
catch (ExternalException)
|
||||||
{
|
{
|
||||||
MessageBox.Show(Language.GetFormattedString("error_nowriteaccess", saveImageFileDialog.FileName).Replace(@"\\", @"\"), Language.GetString("error"));
|
MessageBox.Show("Can't write to " + saveImageFileDialog.FileName.Replace(@"\\", @"\"), "Error");
|
||||||
|
// TODO: Fix
|
||||||
|
//MessageBox.Show(Language.GetFormattedString("error_nowriteaccess", saveImageFileDialog.FileName).Replace(@"\\", @"\"), Language.GetString("error"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,231 +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;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using Dapplo.Language;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
namespace Greenshot.Addons.Core
|
|
||||||
{
|
|
||||||
public delegate void LanguageChangedHandler(object sender, EventArgs e);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This class supplies the GUI with translations, based upon keys.
|
|
||||||
/// The language resources are loaded from the language files found on fixed or supplied paths
|
|
||||||
/// </summary>
|
|
||||||
public class Language
|
|
||||||
{
|
|
||||||
private static LanguageLoader languageLoader = LanguageLoader.Current;
|
|
||||||
/// <summary>
|
|
||||||
/// Get or set the current language
|
|
||||||
/// </summary>
|
|
||||||
public static string CurrentLanguage
|
|
||||||
{
|
|
||||||
get => languageLoader.CurrentLanguage;
|
|
||||||
set { languageLoader.ChangeLanguageAsync(value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return a list of all the supported languages
|
|
||||||
/// </summary>
|
|
||||||
public static IDictionary<string, string> SupportedLanguages => languageLoader.AvailableLanguages;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Check if a resource with prefix.key exists
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="prefix"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <returns>true if available</returns>
|
|
||||||
public static bool HasKey(string prefix, string key)
|
|
||||||
{
|
|
||||||
return languageLoader[prefix].Keys().Contains(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Check if a resource with prefix.key exists
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="prefix"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <returns>true if available</returns>
|
|
||||||
public static bool HasKey(string prefix, Enum key)
|
|
||||||
{
|
|
||||||
return languageLoader[prefix].Keys().Contains(key.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string Translate(object key)
|
|
||||||
{
|
|
||||||
var typename = key.GetType().Name;
|
|
||||||
var enumKey = typename + "." + key;
|
|
||||||
if (HasKey("Core", enumKey))
|
|
||||||
{
|
|
||||||
return GetString("Core", enumKey);
|
|
||||||
}
|
|
||||||
return key.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// TryGet method which combines HasKey & GetString
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="prefix">string with prefix</param>
|
|
||||||
/// <param name="key">string with key</param>
|
|
||||||
/// <param name="languageString">out string</param>
|
|
||||||
/// <returns>bool</returns>
|
|
||||||
public static bool TryGetString(string prefix, string key, out string languageString)
|
|
||||||
{
|
|
||||||
if (languageLoader.Any(l => l.PrefixName() == prefix) && languageLoader[prefix].Keys().Contains(key))
|
|
||||||
{
|
|
||||||
languageString = languageLoader[prefix][key];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
languageString = null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// TryGet method which combines HasKey & GetString
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="key">string with key</param>
|
|
||||||
/// <param name="languageString">out string</param>
|
|
||||||
/// <returns>bool</returns>
|
|
||||||
public static bool TryGetString(string key, out string languageString)
|
|
||||||
{
|
|
||||||
return TryGetString("Core", key, out languageString);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the resource for prefix.key
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="prefix"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <returns>resource or a "string ###prefix.key### not found"</returns>
|
|
||||||
public static string GetString(string prefix, string key)
|
|
||||||
{
|
|
||||||
if (key == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return languageLoader[prefix][key];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the resource for key
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <returns>resource or a "string ###prefix.key### not found"</returns>
|
|
||||||
public static string GetString(string key)
|
|
||||||
{
|
|
||||||
if (key == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return languageLoader["Core"][key];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the resource for key
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="key">Enum</param>
|
|
||||||
/// <returns>resource or a "string ###prefix.key### not found"</returns>
|
|
||||||
public static string GetString(Enum key)
|
|
||||||
{
|
|
||||||
if (key == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return languageLoader["Core"][key.ToString()];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the resource for prefix.key
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="prefix"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <returns>resource or a "string ###prefix.key### not found"</returns>
|
|
||||||
public static string GetString(string prefix, Enum key)
|
|
||||||
{
|
|
||||||
if (key == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return GetString(prefix, key.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the resource for key, format with with string.format an supply the parameters
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="param"></param>
|
|
||||||
/// <returns>formatted resource or a "string ###key### not found"</returns>
|
|
||||||
public static string GetFormattedString(Enum key, object param)
|
|
||||||
{
|
|
||||||
return GetFormattedString(key.ToString(), param);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the resource for prefix.key, format with with string.format an supply the parameters
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="prefix"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="param"></param>
|
|
||||||
/// <returns>formatted resource or a "string ###prefix.key### not found"</returns>
|
|
||||||
public static string GetFormattedString(string prefix, Enum key, object param)
|
|
||||||
{
|
|
||||||
return GetFormattedString(prefix, key.ToString(), param);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the resource for prefix.key, format with with string.format an supply the parameters
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="prefix"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="param"></param>
|
|
||||||
/// <returns>formatted resource or a "string ###prefix.key### not found"</returns>
|
|
||||||
public static string GetFormattedString(string prefix, string key, object param)
|
|
||||||
{
|
|
||||||
if (TryGetString(prefix, key, out var value))
|
|
||||||
{
|
|
||||||
return string.Format(value, param);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $"string ###{prefix}.{key}### not found";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the resource for key, format with with string.format an supply the parameters
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="param"></param>
|
|
||||||
/// <returns>formatted resource or a "string ###key### not found"</returns>
|
|
||||||
public static string GetFormattedString(string key, object param)
|
|
||||||
{
|
|
||||||
return GetFormattedString("Core", key, param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Wpf">
|
<Project Sdk="Microsoft.NET.Sdk.Wpf">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
|
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
<PackageReference Include="System.ComponentModel.Composition" Version="4.5.0" />
|
<PackageReference Include="System.ComponentModel.Composition" Version="4.5.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461' ">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net471' ">
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.VisualBasic" />
|
<Reference Include="Microsoft.VisualBasic" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -32,22 +32,18 @@
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Remove="Interfaces\IGreenshotContract.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CommonServiceLocator">
|
<PackageReference Include="CommonServiceLocator">
|
||||||
<Version>2.0.4</Version>
|
<Version>2.0.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Toasts">
|
<PackageReference Include="Dapplo.CaliburnMicro.Toasts">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.HttpExtensions">
|
<PackageReference Include="Dapplo.HttpExtensions">
|
||||||
<Version>0.9.6</Version>
|
<Version>0.9.6</Version>
|
||||||
|
@ -59,10 +55,10 @@
|
||||||
<Version>0.9.6</Version>
|
<Version>0.9.6</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard">
|
<PackageReference Include="Dapplo.Windows.Clipboard">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Icons">
|
<PackageReference Include="Dapplo.Windows.Icons">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="MahApps.Metro.IconPacks">
|
<PackageReference Include="MahApps.Metro.IconPacks">
|
||||||
<Version>3.0.0-alpha0082</Version>
|
<Version>3.0.0-alpha0082</Version>
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#if !NETCOREAPP3_0
|
||||||
|
|
||||||
using System.ServiceModel;
|
using System.ServiceModel;
|
||||||
|
|
||||||
namespace Greenshot.Addons.Interfaces
|
namespace Greenshot.Addons.Interfaces
|
||||||
|
@ -58,3 +60,5 @@ namespace Greenshot.Addons.Interfaces
|
||||||
void OpenFile(string filename);
|
void OpenFile(string filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
|
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
<FrameworkReference Include="Microsoft.DesktopUI" />
|
<FrameworkReference Include="Microsoft.DesktopUI" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461' ">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net471' ">
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.VisualBasic" />
|
<Reference Include="Microsoft.VisualBasic" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapplo.Windows.Icons">
|
<PackageReference Include="Dapplo.Windows.Icons">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Wpf">
|
<Project Sdk="Microsoft.NET.Sdk.Wpf">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
|
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
<FrameworkReference Include="Microsoft.DesktopUI" />
|
<FrameworkReference Include="Microsoft.DesktopUI" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461' ">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net471' ">
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.VisualBasic" />
|
<Reference Include="Microsoft.VisualBasic" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
|
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
<FrameworkReference Include="Microsoft.DesktopUI" />
|
<FrameworkReference Include="Microsoft.DesktopUI" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461' ">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net471' ">
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.VisualBasic" />
|
<Reference Include="Microsoft.VisualBasic" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
<Version>2.0.4</Version>
|
<Version>2.0.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Svg">
|
<PackageReference Include="Svg">
|
||||||
<Version>2.3.0</Version>
|
<Version>2.3.0</Version>
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.Drawing.Imaging;
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Dapplo.Log.XUnit;
|
using Dapplo.Log.XUnit;
|
||||||
using Greenshot.Gfx;
|
using Greenshot.Gfx;
|
||||||
|
using Greenshot.Tests.Implementation;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
||||||
|
|
|
@ -1,91 +1,12 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net461</TargetFrameworks>
|
<TargetFrameworks>net471</TargetFrameworks>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0' ">
|
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0' ">
|
||||||
<FrameworkReference Include="Microsoft.DesktopUI" />
|
<FrameworkReference Include="Microsoft.DesktopUI" />
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461' ">
|
|
||||||
<Reference Include="Microsoft.VisualBasic" />
|
|
||||||
<Reference Include="PresentationCore" />
|
|
||||||
<Reference Include="PresentationFramework" />
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.ComponentModel.Composition" />
|
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Drawing" />
|
|
||||||
<Reference Include="System.Management" />
|
|
||||||
<Reference Include="System.Net.Http.WebRequest" />
|
|
||||||
<Reference Include="System.Numerics" />
|
|
||||||
<Reference Include="System.Runtime.Caching" />
|
|
||||||
<Reference Include="System.Runtime.Serialization" />
|
|
||||||
<Reference Include="System.ServiceModel" />
|
|
||||||
<Reference Include="System.Windows" />
|
|
||||||
<Reference Include="System.Windows.Forms" />
|
|
||||||
<Reference Include="System.Xaml" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
<Reference Include="WindowsBase" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="IniTests.cs" />
|
|
||||||
<None Include="TestFiles\scroll0.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="TestFiles\scroll105.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="TestFiles\scroll124.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="TestFiles\scroll35.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="TestFiles\scroll70.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="TestFiles\project-feed.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="BenchmarkDotNet">
|
|
||||||
<Version>0.11.1</Version>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="CommandLineParser">
|
|
||||||
<Version>2.3.0</Version>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="CommonServiceLocator">
|
|
||||||
<Version>2.0.4</Version>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth">
|
|
||||||
<Version>0.9.6</Version>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers">
|
|
||||||
<Version>2.6.2</Version>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp">
|
|
||||||
<Version>2.9.0</Version>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
|
||||||
<Version>2.1.0</Version>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="System.Console">
|
<PackageReference Include="System.Console">
|
||||||
<Version>4.3.1</Version>
|
<Version>4.3.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@ -113,6 +34,91 @@
|
||||||
<PackageReference Include="System.Xml.ReaderWriter">
|
<PackageReference Include="System.Xml.ReaderWriter">
|
||||||
<Version>4.3.1</Version>
|
<Version>4.3.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' == 'net471' ">
|
||||||
|
<Reference Include="Microsoft.VisualBasic" />
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.ComponentModel.Composition" />
|
||||||
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Management" />
|
||||||
|
<Reference Include="System.Net.Http.WebRequest" />
|
||||||
|
<Reference Include="System.Numerics" />
|
||||||
|
<Reference Include="System.Runtime.Caching" />
|
||||||
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
|
<Reference Include="System.ServiceModel" />
|
||||||
|
<Reference Include="System.Windows" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xaml" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="IniTests.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="IniTests.cs" />
|
||||||
|
<None Include="TestFiles\scroll0.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="TestFiles\scroll105.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="TestFiles\scroll124.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="TestFiles\scroll35.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="TestFiles\scroll70.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="TestFiles\project-feed.xml">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="BenchmarkDotNet">
|
||||||
|
<Version>0.11.2</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="CommandLineParser">
|
||||||
|
<Version>2.3.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="CommonServiceLocator">
|
||||||
|
<Version>2.0.4</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
||||||
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth">
|
||||||
|
<Version>0.9.6</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Dapplo.Log.XUnit" Version="1.3.11" />
|
||||||
|
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers">
|
||||||
|
<Version>2.6.2</Version>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp">
|
||||||
|
<Version>2.9.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||||
|
<Version>2.1.0</Version>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="xunit">
|
<PackageReference Include="xunit">
|
||||||
<Version>2.4.1</Version>
|
<Version>2.4.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@ -131,12 +137,11 @@
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xunit.StaFact">
|
<PackageReference Include="Xunit.StaFact">
|
||||||
<Version>0.3.2</Version>
|
<Version>0.3.5</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Greenshot.Addon.Dropbox\Greenshot.Addon.Dropbox.csproj" />
|
|
||||||
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
|
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
|
||||||
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
|
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
|
||||||
<ProjectReference Include="..\Greenshot.Gfx.Experimental\Greenshot.Gfx.Experimental.csproj" />
|
<ProjectReference Include="..\Greenshot.Gfx.Experimental\Greenshot.Gfx.Experimental.csproj" />
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#if !NETCOREAPP3_0
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ServiceModel;
|
using System.ServiceModel;
|
||||||
using Greenshot.Addons.Interfaces;
|
using Greenshot.Addons.Interfaces;
|
||||||
|
@ -78,3 +80,4 @@ namespace Greenshot.Components
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#if !NETCOREAPP3_0
|
||||||
|
|
||||||
#region Usings
|
#region Usings
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@ -32,7 +34,6 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Dapplo.Addons;
|
using Dapplo.Addons;
|
||||||
using Dapplo.Ini;
|
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Greenshot.Addons.Components;
|
using Greenshot.Addons.Components;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
|
@ -102,7 +103,7 @@ namespace Greenshot.Components
|
||||||
return Task.Factory.FromAsync((callback, stateObject) => _host.BeginClose(callback, stateObject), asyncResult => _host.EndClose(asyncResult), null);
|
return Task.Factory.FromAsync((callback, stateObject) => _host.BeginClose(callback, stateObject), asyncResult => _host.EndClose(asyncResult), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IGreenshotContract
|
#region IGreenshotContract
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void Exit()
|
public void Exit()
|
||||||
|
@ -116,7 +117,8 @@ namespace Greenshot.Components
|
||||||
Log.Info().WriteLine("Reload requested");
|
Log.Info().WriteLine("Reload requested");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IniConfig.Current?.ReloadAsync().Wait();
|
// TODO: Fix
|
||||||
|
//IniConfig.Current?.ReloadAsync().Wait();
|
||||||
_mainForm.Invoke((MethodInvoker)(() =>
|
_mainForm.Invoke((MethodInvoker)(() =>
|
||||||
{
|
{
|
||||||
// Even update language when needed, this should be done automatically :)
|
// Even update language when needed, this should be done automatically :)
|
||||||
|
@ -178,6 +180,7 @@ namespace Greenshot.Components
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
|
@ -51,7 +51,7 @@ namespace Greenshot.Components
|
||||||
/// <param name="propertyName">string with the property of the ICoreConfiguration to use</param>
|
/// <param name="propertyName">string with the property of the ICoreConfiguration to use</param>
|
||||||
public HotKeyHandler(ICoreConfiguration coreConfiguration, string propertyName)
|
public HotKeyHandler(ICoreConfiguration coreConfiguration, string propertyName)
|
||||||
{
|
{
|
||||||
string RetrieveFunc() => coreConfiguration[propertyName].Value as string;
|
string RetrieveFunc() => coreConfiguration.GetIniValue(propertyName).Value as string;
|
||||||
_propertyChangeSubscription = coreConfiguration
|
_propertyChangeSubscription = coreConfiguration
|
||||||
.OnPropertyChanged(propertyName)
|
.OnPropertyChanged(propertyName)
|
||||||
.Subscribe(pc => UpdateKeyCombination(RetrieveFunc));
|
.Subscribe(pc => UpdateKeyCombination(RetrieveFunc));
|
||||||
|
|
|
@ -32,6 +32,7 @@ using Dapplo.Addons;
|
||||||
using Dapplo.CaliburnMicro;
|
using Dapplo.CaliburnMicro;
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Dapplo.Windows.Multimedia;
|
using Dapplo.Windows.Multimedia;
|
||||||
|
using Dapplo.Windows.Multimedia.Enums;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#if !NETCOREAPP3_0
|
||||||
|
|
||||||
#region Usings
|
#region Usings
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@ -243,3 +245,4 @@ namespace Greenshot.Components
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
|
@ -386,20 +386,21 @@ namespace Greenshot.Forms
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
case Keys.I:
|
// TODO: Open configuration location
|
||||||
try
|
// case Keys.I:
|
||||||
{
|
//try
|
||||||
using (Process.Start("\"" + IniConfig.Current.IniLocation + "\""))
|
//{
|
||||||
{
|
// using (Process.Start("\"" + IniConfig.Current.IniLocation + "\""))
|
||||||
// Ignore
|
// {
|
||||||
}
|
// // Ignore
|
||||||
}
|
// }
|
||||||
catch (Exception)
|
//}
|
||||||
{
|
//catch (Exception)
|
||||||
MessageBox.Show("Couldn't open the greenshot.ini, it's located here: " + IniConfig.Current.IniLocation, "Error opening greeenshot.ini", MessageBoxButtons.OK,
|
//{
|
||||||
MessageBoxIcon.Asterisk);
|
// MessageBox.Show("Couldn't open the greenshot.ini, it's located here: " + IniConfig.Current.IniLocation, "Error opening greeenshot.ini", MessageBoxButtons.OK,
|
||||||
}
|
// MessageBoxIcon.Asterisk);
|
||||||
break;
|
//}
|
||||||
|
//break;
|
||||||
default:
|
default:
|
||||||
return base.ProcessCmdKey(ref msg, keyData);
|
return base.ProcessCmdKey(ref msg, keyData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@ using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Dapplo.Language;
|
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
|
|
||||||
|
@ -70,11 +69,12 @@ namespace Greenshot.Forms
|
||||||
comboBoxLanguage.DisplayMember = "Value";
|
comboBoxLanguage.DisplayMember = "Value";
|
||||||
comboBoxLanguage.ValueMember = "Key";
|
comboBoxLanguage.ValueMember = "Key";
|
||||||
|
|
||||||
// Set datasource last to prevent problems
|
// Set datasource last to prevent problems
|
||||||
// See: http://www.codeproject.com/KB/database/scomlistcontrolbinding.aspx?fid=111644
|
// See: http://www.codeproject.com/KB/database/scomlistcontrolbinding.aspx?fid=111644
|
||||||
comboBoxLanguage.DataSource = LanguageLoader.Current.AvailableLanguages.ToList();
|
// TODO: Get languages
|
||||||
|
//comboBoxLanguage.DataSource = LanguageLoader.Current.AvailableLanguages.ToList();
|
||||||
|
|
||||||
var currentLanguage = LanguageLoader.Current.CurrentLanguage;
|
var currentLanguage = "en-US"; // LanguageLoader.Current.CurrentLanguage;
|
||||||
|
|
||||||
if (currentLanguage != null)
|
if (currentLanguage != null)
|
||||||
{
|
{
|
||||||
|
@ -88,14 +88,14 @@ namespace Greenshot.Forms
|
||||||
|
|
||||||
// Close again when there is only one language, this shows the form briefly!
|
// Close again when there is only one language, this shows the form briefly!
|
||||||
// But the use-case is not so interesting, only happens once, to invest a lot of time here.
|
// But the use-case is not so interesting, only happens once, to invest a lot of time here.
|
||||||
if (LanguageLoader.Current.AvailableLanguages.Count != 1)
|
if (false) //LanguageLoader.Current.AvailableLanguages.Count != 1)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
comboBoxLanguage.SelectedValue = LanguageLoader.Current.AvailableLanguages.Keys.FirstOrDefault();
|
comboBoxLanguage.SelectedValue = "en-US"; // LanguageLoader.Current.AvailableLanguages.Keys.FirstOrDefault();
|
||||||
// TODO: Check
|
// TODO: Change language
|
||||||
var ignoreTask = LanguageLoader.Current.ChangeLanguageAsync(SelectedLanguage);
|
//var ignoreTask = LanguageLoader.Current.ChangeLanguageAsync(SelectedLanguage);
|
||||||
_properOkPressed = true;
|
_properOkPressed = true;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,8 @@ namespace Greenshot.Forms
|
||||||
{
|
{
|
||||||
_properOkPressed = true;
|
_properOkPressed = true;
|
||||||
// Fix for Bug #3431100
|
// Fix for Bug #3431100
|
||||||
Language.CurrentLanguage = SelectedLanguage;
|
// TODO: Change language
|
||||||
|
//Language.CurrentLanguage = SelectedLanguage;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ using System.Reflection;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Autofac.Features.OwnedInstances;
|
using Autofac.Features.OwnedInstances;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
using Dapplo.Ini;
|
|
||||||
using Dapplo.Windows.Desktop;
|
using Dapplo.Windows.Desktop;
|
||||||
using Greenshot.Destinations;
|
using Greenshot.Destinations;
|
||||||
using Greenshot.Help;
|
using Greenshot.Help;
|
||||||
|
@ -60,6 +59,7 @@ using Greenshot.Gfx;
|
||||||
using Greenshot.Ui.Configuration.ViewModels;
|
using Greenshot.Ui.Configuration.ViewModels;
|
||||||
using Message = System.Windows.Forms.Message;
|
using Message = System.Windows.Forms.Message;
|
||||||
using Screen = System.Windows.Forms.Screen;
|
using Screen = System.Windows.Forms.Screen;
|
||||||
|
using Dapplo.Config.Ini;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -933,7 +933,7 @@ namespace Greenshot.Forms
|
||||||
var enumTypeName = typeof(WindowCaptureModes).Name;
|
var enumTypeName = typeof(WindowCaptureModes).Name;
|
||||||
foreach (WindowCaptureModes captureMode in Enum.GetValues(typeof(WindowCaptureModes)))
|
foreach (WindowCaptureModes captureMode in Enum.GetValues(typeof(WindowCaptureModes)))
|
||||||
{
|
{
|
||||||
selectList.AddItem(Language.GetString(enumTypeName + "." + captureMode), captureMode, _coreConfiguration.WindowCaptureMode == captureMode);
|
selectList.AddItem(_greenshotLanguage[enumTypeName + "." + captureMode], captureMode, _coreConfiguration.WindowCaptureMode == captureMode);
|
||||||
}
|
}
|
||||||
selectList.CheckedChanged += QuickSettingCaptureModeChanged;
|
selectList.CheckedChanged += QuickSettingCaptureModeChanged;
|
||||||
contextmenu_quicksettings.DropDownItems.Add(selectList);
|
contextmenu_quicksettings.DropDownItems.Add(selectList);
|
||||||
|
@ -947,7 +947,7 @@ namespace Greenshot.Forms
|
||||||
|
|
||||||
foreach (var outputPrintIniValue in _coreConfiguration.GetIniValues().Values.Where(value => value.PropertyName.StartsWith("OutputPrint") && value.ValueType == typeof(bool) && !_coreConfiguration.IsWriteProtected(value.PropertyName)))
|
foreach (var outputPrintIniValue in _coreConfiguration.GetIniValues().Values.Where(value => value.PropertyName.StartsWith("OutputPrint") && value.ValueType == typeof(bool) && !_coreConfiguration.IsWriteProtected(value.PropertyName)))
|
||||||
{
|
{
|
||||||
selectList.AddItem(Language.GetString(outputPrintIniValue.PropertyName), outputPrintIniValue, (bool) outputPrintIniValue.Value);
|
selectList.AddItem(_greenshotLanguage[outputPrintIniValue.PropertyName], outputPrintIniValue, (bool) outputPrintIniValue.Value);
|
||||||
}
|
}
|
||||||
if (selectList.DropDownItems.Count > 0)
|
if (selectList.DropDownItems.Count > 0)
|
||||||
{
|
{
|
||||||
|
@ -965,18 +965,18 @@ namespace Greenshot.Forms
|
||||||
Text = _greenshotLanguage.SettingsVisualization
|
Text = _greenshotLanguage.SettingsVisualization
|
||||||
};
|
};
|
||||||
|
|
||||||
var iniValue = _coreConfiguration["PlayCameraSound"];
|
var iniValue = _coreConfiguration.GetIniValue("PlayCameraSound");
|
||||||
var languageKey = _coreConfiguration.GetTagValue(iniValue.PropertyName, ConfigTags.LanguageKey) as string;
|
var languageKey = _coreConfiguration.GetTagValue(iniValue.PropertyName, ConfigTags.LanguageKey) as string;
|
||||||
|
|
||||||
if (!_coreConfiguration.IsWriteProtected(iniValue.PropertyName))
|
if (!_coreConfiguration.IsWriteProtected(iniValue.PropertyName))
|
||||||
{
|
{
|
||||||
selectList.AddItem(Language.GetString(languageKey), iniValue, (bool) iniValue.Value);
|
selectList.AddItem(_greenshotLanguage[languageKey], iniValue, (bool) iniValue.Value);
|
||||||
}
|
}
|
||||||
iniValue = _coreConfiguration["ShowTrayNotification"];
|
iniValue = _coreConfiguration.GetIniValue("ShowTrayNotification");
|
||||||
languageKey = _coreConfiguration.GetTagValue(iniValue.PropertyName, ConfigTags.LanguageKey) as string;
|
languageKey = _coreConfiguration.GetTagValue(iniValue.PropertyName, ConfigTags.LanguageKey) as string;
|
||||||
if (!_coreConfiguration.IsWriteProtected(iniValue.PropertyName))
|
if (!_coreConfiguration.IsWriteProtected(iniValue.PropertyName))
|
||||||
{
|
{
|
||||||
selectList.AddItem(Language.GetString(languageKey), iniValue, (bool) iniValue.Value);
|
selectList.AddItem(_greenshotLanguage[languageKey], iniValue, (bool) iniValue.Value);
|
||||||
}
|
}
|
||||||
if (selectList.DropDownItems.Count > 0)
|
if (selectList.DropDownItems.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,8 +29,8 @@ using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Greenshot.Gfx;
|
using Greenshot.Gfx;
|
||||||
using Dapplo.Ini;
|
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
|
using Greenshot.Addons.Config.Impl;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -41,8 +41,9 @@ namespace Greenshot.Forms
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class ToolStripMenuSelectList : ToolStripMenuItem
|
public sealed class ToolStripMenuSelectList : ToolStripMenuItem
|
||||||
{
|
{
|
||||||
private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get<ICoreConfiguration>();
|
// TODO: Solve, was static reference!
|
||||||
private static Image _defaultImage;
|
private static readonly ICoreConfiguration CoreConfig = new CoreConfigurationImpl();
|
||||||
|
private static Image _defaultImage;
|
||||||
private readonly bool _multiCheckAllowed;
|
private readonly bool _multiCheckAllowed;
|
||||||
private bool _updateInProgress;
|
private bool _updateInProgress;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
|
<TargetFrameworks>netcoreapp3.0;net471</TargetFrameworks>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<ApplicationIcon>icons\applicationIcon\icon.ico</ApplicationIcon>
|
<ApplicationIcon>icons\applicationIcon\icon.ico</ApplicationIcon>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461' ">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net471' ">
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.VisualBasic" />
|
<Reference Include="Microsoft.VisualBasic" />
|
||||||
<Reference Include="System.ComponentModel.Composition" />
|
<Reference Include="System.ComponentModel.Composition" />
|
||||||
|
@ -72,6 +72,7 @@
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
|
<Reference Include="WindowsFormsIntegration" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -84,17 +85,20 @@
|
||||||
<PackageReference Include="CommonServiceLocator">
|
<PackageReference Include="CommonServiceLocator">
|
||||||
<Version>2.0.4</Version>
|
<Version>2.0.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="Dapplo.CaliburnMicro.Dapp">
|
||||||
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Metro">
|
<PackageReference Include="Dapplo.CaliburnMicro.Metro">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Toasts">
|
<PackageReference Include="Dapplo.CaliburnMicro.Toasts">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
||||||
<Version>1.1.1-gd01f910204</Version>
|
<Version>1.1.10-ge2d1078449</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet">
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet">
|
||||||
<Version>0.9.6</Version>
|
<Version>0.9.6</Version>
|
||||||
|
@ -109,13 +113,13 @@
|
||||||
<Version>1.3.11</Version>
|
<Version>1.3.11</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard">
|
<PackageReference Include="Dapplo.Windows.Clipboard">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Icons">
|
<PackageReference Include="Dapplo.Windows.Icons">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Multimedia">
|
<PackageReference Include="Dapplo.Windows.Multimedia">
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.19</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="gong-wpf-dragdrop">
|
<PackageReference Include="gong-wpf-dragdrop">
|
||||||
<Version>1.1.0</Version>
|
<Version>1.1.0</Version>
|
||||||
|
@ -129,16 +133,10 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Greenshot.Addon.InternetExplorer\Greenshot.Addon.InternetExplorer.csproj" />
|
||||||
<ProjectReference Include="..\Greenshot.Addon.LegacyEditor\Greenshot.Addon.LegacyEditor.csproj" />
|
<ProjectReference Include="..\Greenshot.Addon.LegacyEditor\Greenshot.Addon.LegacyEditor.csproj" />
|
||||||
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
|
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
|
||||||
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
|
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
|
||||||
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
|
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Remove="Components\GreenshotClient.cs" />
|
|
||||||
<Compile Remove="Components\GreenshotServer.cs" />
|
|
||||||
<Compile Remove="Components\UpdateService.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
|
@ -44,7 +44,7 @@ namespace Greenshot.Help
|
||||||
|
|
||||||
public static void LoadHelp()
|
public static void LoadHelp()
|
||||||
{
|
{
|
||||||
var uri = FindOnlineHelpUrl(Language.CurrentLanguage);// ?? Language.HelpFilePath;
|
var uri = FindOnlineHelpUrl("en-US");// Language.CurrentLanguage);// ?? Language.HelpFilePath;
|
||||||
Process.Start(uri);
|
Process.Start(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Dapplo.Ini;
|
|
||||||
using Dapplo.Windows.App;
|
using Dapplo.Windows.App;
|
||||||
using Dapplo.Windows.Desktop;
|
using Dapplo.Windows.Desktop;
|
||||||
using Greenshot.Destinations;
|
using Greenshot.Destinations;
|
||||||
|
@ -51,6 +50,7 @@ using Greenshot.Components;
|
||||||
using Greenshot.Core.Enums;
|
using Greenshot.Core.Enums;
|
||||||
using Greenshot.Gfx;
|
using Greenshot.Gfx;
|
||||||
using LangKey = Greenshot.Configuration.LangKey;
|
using LangKey = Greenshot.Configuration.LangKey;
|
||||||
|
using Greenshot.Addons.Config.Impl;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -62,7 +62,8 @@ namespace Greenshot.Helpers
|
||||||
public class CaptureHelper : IDisposable
|
public class CaptureHelper : IDisposable
|
||||||
{
|
{
|
||||||
private static readonly LogSource Log = new LogSource();
|
private static readonly LogSource Log = new LogSource();
|
||||||
private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get<ICoreConfiguration>();
|
// TODO: Solve, was static reference!
|
||||||
|
private static readonly ICoreConfiguration CoreConfig = new CoreConfigurationImpl();
|
||||||
private readonly bool _captureMouseCursor;
|
private readonly bool _captureMouseCursor;
|
||||||
private ICapture _capture;
|
private ICapture _capture;
|
||||||
private CaptureMode _captureMode;
|
private CaptureMode _captureMode;
|
||||||
|
@ -425,7 +426,8 @@ namespace Greenshot.Helpers
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show(Language.GetString("clipboard_noimage"));
|
// TODO: Translation
|
||||||
|
//MessageBox.Show(Language.GetString("clipboard_noimage"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CaptureMode.File:
|
case CaptureMode.File:
|
||||||
|
@ -449,7 +451,8 @@ namespace Greenshot.Helpers
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.Error().WriteLine(e, e.Message);
|
Log.Error().WriteLine(e, e.Message);
|
||||||
MessageBox.Show(Language.GetFormattedString(LangKey.error_openfile, filename));
|
// TODO: Translation
|
||||||
|
//MessageBox.Show(Language.GetFormattedString(LangKey.error_openfile, filename));
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -458,7 +461,8 @@ namespace Greenshot.Helpers
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.Error().WriteLine(e, e.Message);
|
Log.Error().WriteLine(e, e.Message);
|
||||||
MessageBox.Show(Language.GetFormattedString(LangKey.error_openfile, filename));
|
// TODO: Translation
|
||||||
|
//MessageBox.Show(Language.GetFormattedString(LangKey.error_openfile, filename));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fileImage != null)
|
if (fileImage != null)
|
||||||
|
|
|
@ -31,8 +31,8 @@ using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Dapplo.Ini;
|
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
|
using Greenshot.Addons.Config.Impl;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
using Greenshot.Addons.Interfaces;
|
using Greenshot.Addons.Interfaces;
|
||||||
using Greenshot.Addons.Interfaces.Plugin;
|
using Greenshot.Addons.Interfaces.Plugin;
|
||||||
|
@ -77,11 +77,12 @@ namespace Greenshot.Helpers
|
||||||
#endregion Enums
|
#endregion Enums
|
||||||
|
|
||||||
private static readonly LogSource Log = new LogSource();
|
private static readonly LogSource Log = new LogSource();
|
||||||
private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get<ICoreConfiguration>();
|
// TODO: Solve, was static reference!
|
||||||
|
private static readonly ICoreConfiguration CoreConfig = new CoreConfigurationImpl();
|
||||||
|
|
||||||
#region Member Variables
|
#region Member Variables
|
||||||
|
|
||||||
private readonly ManualResetEvent _manualResetEvent;
|
private readonly ManualResetEvent _manualResetEvent;
|
||||||
|
|
||||||
#endregion Member Variables
|
#endregion Member Variables
|
||||||
|
|
||||||
|
|
|
@ -131,9 +131,10 @@ namespace Greenshot.Helpers
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.Error().WriteLine(e, "An error ocurred while trying to print");
|
Log.Error().WriteLine(e, "An error ocurred while trying to print");
|
||||||
MessageBox.Show(Language.GetString(LangKey.print_error), Language.GetString(LangKey.error));
|
// TODO: Translation
|
||||||
}
|
//MessageBox.Show(Language.GetString(LangKey.print_error), Language.GetString(LangKey.error));
|
||||||
return returnPrinterSettings;
|
}
|
||||||
|
return returnPrinterSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -164,9 +165,10 @@ namespace Greenshot.Helpers
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.Error().WriteLine(e, "An error ocurred while trying to print");
|
Log.Error().WriteLine(e, "An error ocurred while trying to print");
|
||||||
MessageBox.Show(Language.GetString(LangKey.print_error), Language.GetString(LangKey.error));
|
// TODO: Translation
|
||||||
}
|
//MessageBox.Show(Language.GetString(LangKey.print_error), Language.GetString(LangKey.error));
|
||||||
return returnPrinterSettings;
|
}
|
||||||
|
return returnPrinterSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsColorPrint()
|
private bool IsColorPrint()
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Dapplo.Ini;
|
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
|
using Greenshot.Addons.Config.Impl;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
using Greenshot.Addons.Interfaces;
|
using Greenshot.Addons.Interfaces;
|
||||||
|
|
||||||
|
@ -40,9 +40,10 @@ namespace Greenshot.Processors
|
||||||
public class TitleFixProcessor : AbstractProcessor
|
public class TitleFixProcessor : AbstractProcessor
|
||||||
{
|
{
|
||||||
private static readonly LogSource Log = new LogSource();
|
private static readonly LogSource Log = new LogSource();
|
||||||
private static readonly ICoreConfiguration config = IniConfig.Current.Get<ICoreConfiguration>();
|
// TODO: Solve, was static reference!
|
||||||
|
private static readonly ICoreConfiguration config = new CoreConfigurationImpl();
|
||||||
|
|
||||||
public TitleFixProcessor()
|
public TitleFixProcessor()
|
||||||
{
|
{
|
||||||
var corruptKeys = new List<string>();
|
var corruptKeys = new List<string>();
|
||||||
foreach (var key in config.ActiveTitleFixes)
|
foreach (var key in config.ActiveTitleFixes)
|
||||||
|
|
|
@ -32,8 +32,8 @@ using Autofac.Features.OwnedInstances;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
using Dapplo.Addons.Bootstrapper;
|
using Dapplo.Addons.Bootstrapper;
|
||||||
using Dapplo.CaliburnMicro.Dapp;
|
using Dapplo.CaliburnMicro.Dapp;
|
||||||
using Dapplo.Ini.Converters;
|
using Dapplo.Config.Ini.Converters;
|
||||||
using Dapplo.Language;
|
using Dapplo.Config.Language;
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Dapplo.Log.Loggers;
|
using Dapplo.Log.Loggers;
|
||||||
using Dapplo.Utils;
|
using Dapplo.Utils;
|
||||||
|
@ -71,7 +71,6 @@ namespace Greenshot
|
||||||
.Create()
|
.Create()
|
||||||
.WithApplicationName("Greenshot")
|
.WithApplicationName("Greenshot")
|
||||||
.WithMutex("F48E86D3-E34C-4DB7-8F8F-9A0EA55F0D08")
|
.WithMutex("F48E86D3-E34C-4DB7-8F8F-9A0EA55F0D08")
|
||||||
.WithConfigSupport()
|
|
||||||
.WithCaliburnMicro()
|
.WithCaliburnMicro()
|
||||||
.WithoutCopyOfEmbeddedAssemblies()
|
.WithoutCopyOfEmbeddedAssemblies()
|
||||||
.WithAssemblyPatterns("Greenshot.Addon*")
|
.WithAssemblyPatterns("Greenshot.Addon*")
|
||||||
|
|
|
@ -30,7 +30,6 @@ using Caliburn.Micro;
|
||||||
using Dapplo.CaliburnMicro.Configuration;
|
using Dapplo.CaliburnMicro.Configuration;
|
||||||
using Dapplo.CaliburnMicro.Extensions;
|
using Dapplo.CaliburnMicro.Extensions;
|
||||||
using Dapplo.CaliburnMicro.Metro;
|
using Dapplo.CaliburnMicro.Metro;
|
||||||
using Dapplo.Language;
|
|
||||||
using Dapplo.Utils.Extensions;
|
using Dapplo.Utils.Extensions;
|
||||||
using Greenshot.Addons;
|
using Greenshot.Addons;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
|
@ -60,13 +59,15 @@ namespace Greenshot.Ui.Configuration.ViewModels
|
||||||
/// Used from the View
|
/// Used from the View
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// ReSharper disable once UnusedMember.Global
|
// ReSharper disable once UnusedMember.Global
|
||||||
public IDictionary<string, string> AvailableLanguages => LanguageLoader.Current.AvailableLanguages;
|
// TODO: Fix
|
||||||
|
public IDictionary<string, string> AvailableLanguages => new Dictionary<string, string>();//LanguageLoader.Current.AvailableLanguages;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Can the login button be pressed?
|
/// Can the login button be pressed?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
// TODO: Fix
|
||||||
public bool CanChangeLanguage
|
public bool CanChangeLanguage
|
||||||
=> !string.IsNullOrWhiteSpace(CoreConfiguration.Language) && CoreConfiguration.Language != LanguageLoader.Current.CurrentLanguage;
|
=> !string.IsNullOrWhiteSpace(CoreConfiguration.Language); // && CoreConfiguration.Language != LanguageLoader.Current.CurrentLanguage;
|
||||||
|
|
||||||
public IMetroConfiguration MetroConfiguration { get; }
|
public IMetroConfiguration MetroConfiguration { get; }
|
||||||
|
|
||||||
|
@ -102,7 +103,8 @@ namespace Greenshot.Ui.Configuration.ViewModels
|
||||||
MetroWindowManager.ChangeThemeAccent(MetroConfiguration.ThemeAccent);
|
MetroWindowManager.ChangeThemeAccent(MetroConfiguration.ThemeAccent);
|
||||||
|
|
||||||
CoreConfiguration.CommitTransaction();
|
CoreConfiguration.CommitTransaction();
|
||||||
Execute.OnUIThread(async () => { await LanguageLoader.Current.ChangeLanguageAsync(CoreConfiguration.Language).ConfigureAwait(false); });
|
// TODO: Fix
|
||||||
|
//Execute.OnUIThread(async () => { await LanguageLoader.Current.ChangeLanguageAsync(CoreConfiguration.Language).ConfigureAwait(false); });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue