mirror of
https://github.com/greenshot/greenshot
synced 2025-08-22 14:24:43 -07:00
Using a workaround for current WPF issues.
This commit is contained in:
parent
74cf71eeaa
commit
b64c85afed
10 changed files with 17 additions and 110 deletions
|
@ -2,6 +2,7 @@
|
|||
<configuration>
|
||||
<packageSources>
|
||||
<add key="nugetv3" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="uwpcommunitytoolkit" value="https://dotnet.myget.org/F/uwpcommunitytoolkit/api/v3/index.json" />
|
||||
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
|
||||
<add key="dotnet-windowsdesktop" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
|
||||
<add key="aspnet-aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
|
||||
|
|
|
@ -15,12 +15,12 @@ steps:
|
|||
- task: DotNetCoreInstaller@0
|
||||
displayName: 'Install .NET Core SDK 3.0'
|
||||
inputs:
|
||||
version: '3.0.100-preview7-012284'
|
||||
version: '3.0.100-preview7-012395'
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet 5.0.0'
|
||||
displayName: 'Use NuGet 5.0.2'
|
||||
inputs:
|
||||
versionSpec: 5.0.0
|
||||
versionSpec: 5.0.2
|
||||
checkLatest: true
|
||||
|
||||
- task: NuGetCommand@2
|
||||
|
|
|
@ -227,14 +227,14 @@ Global
|
|||
{D106F86C-CD3D-44FF-B151-2A5D47268B5C}.Release|x86.Build.0 = Release|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Debug|x64.Build.0 = Debug|x64
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Release|x64.ActiveCfg = Release|x64
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Release|x64.Build.0 = Release|x64
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Release|x64.Build.0 = Release|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{F041C685-EB96-4ED1-9ACE-0F5BD836610F}.Release|x86.Build.0 = Release|Any CPU
|
||||
{5D594C8A-2137-46E1-8D01-B83662825C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.18362.2002-preview" />
|
||||
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview4.19212.13" />
|
||||
<PackageReference Include="Microsoft.Toolkit.Forms.UI.Controls" Version="6.0.0-preview4.1" />
|
||||
<TrimmerRootAssembly Include="Microsoft.Windows.SDK.Contracts" />
|
||||
<TrimmerRootAssembly Include="System.Runtime.WindowsRuntime" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -23,7 +23,6 @@ using Autofac;
|
|||
using Dapplo.Addons;
|
||||
using Dapplo.Windows.Common;
|
||||
using Greenshot.Addons.Components;
|
||||
using Greenshot.Addons.Interfaces;
|
||||
|
||||
namespace Greenshot.Addon.Win10
|
||||
{
|
||||
|
@ -49,15 +48,11 @@ namespace Greenshot.Addon.Win10
|
|||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
|
||||
builder
|
||||
.RegisterType<Win10FormEnhancer>()
|
||||
.As<IFormEnhancer>()
|
||||
.SingleInstance();
|
||||
|
||||
builder
|
||||
.RegisterType<Win10ShareDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
|
||||
base.Load(builder);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,91 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2019 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;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Greenshot.Addons.Interfaces;
|
||||
using Microsoft.Toolkit.Forms.UI.XamlHost;
|
||||
|
||||
namespace Greenshot.Addon.Win10
|
||||
{
|
||||
public class Win10FormEnhancer : IFormEnhancer
|
||||
{
|
||||
private WindowsXamlHost _inkCanvasHost;
|
||||
private WindowsXamlHost _inkToolbarHost;
|
||||
private Windows.UI.Xaml.Controls.InkCanvas _inkCanvas;
|
||||
private Windows.UI.Xaml.Controls.InkToolbar _inkToolbar;
|
||||
|
||||
public void InitializeComponent(Form target)
|
||||
{
|
||||
if (target is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// InkCanvas
|
||||
_inkCanvasHost = new WindowsXamlHost
|
||||
{
|
||||
InitialTypeName = "Windows.UI.Xaml.Controls.InkCanvas",
|
||||
Dock = DockStyle.Fill,
|
||||
BackColor = Color.Transparent,
|
||||
|
||||
};
|
||||
_inkCanvasHost.ChildChanged += InkCanvas_ChildChanged;
|
||||
|
||||
// InkToolbar
|
||||
_inkToolbarHost = new WindowsXamlHost
|
||||
{
|
||||
InitialTypeName = "Windows.UI.Xaml.Controls.InkToolbar",
|
||||
// Layout
|
||||
Top = 0,
|
||||
Left = 0,
|
||||
Height = 50,
|
||||
Dock = DockStyle.Top,
|
||||
BackColor = Color.Transparent
|
||||
};
|
||||
_inkToolbarHost.ChildChanged += InkToolbar_ChildChanged;
|
||||
|
||||
// Add to Window
|
||||
target.Controls.Add(_inkToolbarHost);
|
||||
target.Controls.Add(_inkCanvasHost);
|
||||
}
|
||||
|
||||
private void InkToolbar_ChildChanged(object sender, EventArgs e)
|
||||
{
|
||||
_inkToolbar = ((WindowsXamlHost)sender).Child as Windows.UI.Xaml.Controls.InkToolbar;
|
||||
InitializeUwpControls();
|
||||
}
|
||||
|
||||
private void InkCanvas_ChildChanged(object sender, EventArgs e)
|
||||
{
|
||||
_inkCanvas = ((WindowsXamlHost)sender).Child as Windows.UI.Xaml.Controls.InkCanvas;
|
||||
InitializeUwpControls();
|
||||
}
|
||||
|
||||
private void InitializeUwpControls()
|
||||
{
|
||||
if (_inkToolbar == null || _inkCanvas == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_inkToolbar.TargetInkCanvas = _inkCanvas;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@
|
|||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="gong-wpf-dragdrop" Version="2.0.3" />
|
||||
<PackageReference Include="MahApps.Metro.IconPacks" Version="3.0.0-alpha0146" />
|
||||
<PackageReference Include="Svg" Version="2.4.3" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>8</LangVersion>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -44,8 +44,6 @@
|
|||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="gong-wpf-dragdrop" Version="2.0.2" />
|
||||
<PackageReference Include="Svg" Version="2.4.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -53,6 +51,7 @@
|
|||
<ProjectReference Include="..\Greenshot.Addon.InternetExplorer\Greenshot.Addon.InternetExplorer.csproj" />
|
||||
<ProjectReference Include="..\Greenshot.Addon.LegacyEditor\Greenshot.Addon.LegacyEditor.csproj" />
|
||||
<ProjectReference Include="..\Greenshot.Addon.Office\Greenshot.Addon.Office.csproj" />
|
||||
<ProjectReference Include="..\Greenshot.Addon.Win10\Greenshot.Addon.Win10.csproj" />
|
||||
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
|
||||
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
|
||||
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
|
@ -56,6 +57,9 @@ namespace Greenshot
|
|||
[STAThread]
|
||||
public static int Main(string[] arguments)
|
||||
{
|
||||
// Workaround for https://github.com/dotnet/wpf/issues/684 & https://github.com/dotnet/wpf/issues/913
|
||||
CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
|
||||
|
||||
// TODO: Set via build
|
||||
StringEncryptionTypeConverter.RgbIv = "dlgjowejgogkklwj";
|
||||
StringEncryptionTypeConverter.RgbKey = "lsjvkwhvwujkagfauguwcsjgu2wueuff";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue