Skip to content

Commit

Permalink
feat(uwp): removed UWP support
Browse files Browse the repository at this point in the history
  • Loading branch information
godrose committed Jan 24, 2022
1 parent 0f98f09 commit 96d9670
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 88 deletions.
2 changes: 0 additions & 2 deletions devops/pack/LogoFX.Client.Core/pack.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ rmdir /Q /S ref
cd ..
mkdir netcoreapp3.1
robocopy ../../../../../src/Bin/netcore/Release netcoreapp3.1 LogoFX.Client.Core.Platform.* /E
mkdir uap10.0
robocopy ../../../../../src/Bin/uwp/Release uap10.0 LogoFX.Client.Core.Platform.* /E
mkdir monoandroid403
robocopy ../../../../../src/Bin/android/Release monoandroid403 LogoFX.Client.Core.Platform.* /E
mkdir xamarin.ios10
Expand Down
3 changes: 0 additions & 3 deletions src/LogoFX.Client.Core.Platform/src/CommonProperties.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#if NET || NETCORE
using System.Windows;
#endif
#if NETFX_CORE || WINDOWS_UWP
using Windows.UI.Xaml;
#endif

namespace LogoFX.Client.Core
{
Expand Down
23 changes: 3 additions & 20 deletions src/LogoFX.Client.Core.Platform/src/Consts.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if NETFX_CORE || WINDOWS_UWP
using Windows.UI.Core;
#endif

namespace LogoFX.Client.Core
namespace LogoFX.Client.Core
{
/// <summary>
/// Dispatcher-related constants.
Expand All @@ -12,20 +8,7 @@ public static class Consts
/// <summary>
/// The dispatcher priority
/// </summary>
public const
#if NET || NETCORE
System.Windows.Threading.DispatcherPriority
#endif
#if NETFX_CORE || WINDOWS_UWP
CoreDispatcherPriority
#endif
DispatcherPriority =
#if NET || NETCORE
System.Windows.Threading.DispatcherPriority.DataBind
#endif
#if NETFX_CORE || WINDOWS_UWP
CoreDispatcherPriority.Normal
#endif
;
public const System.Windows.Threading.DispatcherPriority
DispatcherPriority = System.Windows.Threading.DispatcherPriority.DataBind;
}
}
46 changes: 3 additions & 43 deletions src/LogoFX.Client.Core.Platform/src/PlatformDispatch.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
#if WINDOWS_UWP || NETFX_CORE
using Windows.UI.Core;
using Windows.UI.Xaml.Controls;
#endif
#if NET || NETCORE
using System.Windows.Threading;
#endif

using LogoFX.Client.Core;

// ReSharper disable once CheckNamespace
Expand All @@ -16,14 +9,7 @@ namespace System.Threading
/// </summary>
public class PlatformDispatch : IDispatch
{
private Action<Action, bool,
#if NET || NETCORE
DispatcherPriority
#endif
#if NETFX_CORE || WINDOWS_UWP
CoreDispatcherPriority
#endif
> _dispatch;
private Action<Action, bool, DispatcherPriority> _dispatch;

private void EnsureDispatch()
{
Expand All @@ -38,32 +24,18 @@ private void EnsureDispatch()
/// </summary>
public void InitializeDispatch()
{
#if NET || NETCORE
var dispatcher = Dispatcher.CurrentDispatcher;
if (dispatcher == null)
throw new InvalidOperationException("Dispatch is not initialized correctly");
#endif
#if NETFX_CORE || WINDOWS_UWP
CoreDispatcher dispatcher = new UserControl().Dispatcher;
#endif
_dispatch = (action, @async, priority) =>
{
#if NET || NETCORE
if (!@async && dispatcher.CheckAccess())
#else
if (!@async)
#endif
{
action();
}
else
{
#if NET || NETCORE
dispatcher.BeginInvoke(action, priority);
#endif
#if NETFX_CORE || WINDOWS_UWP
dispatcher.RunAsync(priority, () => action());
#endif
}
};
}
Expand All @@ -80,13 +52,7 @@ public void BeginOnUiThread(Action action)
/// <param name="priority">Desired priority</param>
/// <param name="action">Action</param>
public void BeginOnUiThread(
#if NET || NETCORE
DispatcherPriority
#endif
#if NETFX_CORE || WINDOWS_UWP
CoreDispatcherPriority
#endif
priority, Action action)
DispatcherPriority priority, Action action)
{
EnsureDispatch();
_dispatch(action, true, priority);
Expand All @@ -104,13 +70,7 @@ public void OnUiThread(Action action)
/// <param name="priority">Desired priority</param>
/// <param name="action">Action</param>
public void OnUiThread(
#if NET || NETCORE
DispatcherPriority
#endif
#if NETFX_CORE || WINDOWS_UWP
CoreDispatcherPriority
#endif
priority, Action action)
DispatcherPriority priority, Action action)
{
EnsureDispatch();
_dispatch(action, false, priority);
Expand Down
21 changes: 1 addition & 20 deletions src/LogoFX.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogoFX.Client.Core.Platform
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogoFX.Client.Core.Platform.NETFramework", "LogoFX.Client.Core.Platform\netframework\LogoFX.Client.Core.Platform.NETFramework.csproj", "{27C2028A-1934-447F-953D-A6E2CB2851E1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogoFX.Client.Core.Platform.UWP", "LogoFX.Client.Core.Platform\uwp\LogoFX.Client.Core.Platform.UWP.csproj", "{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogoFX.Client.Core.Platform.NETCore.Specs", "LogoFX.Client.Core.Platform.NETCore.Specs\LogoFX.Client.Core.Platform.NETCore.Specs.csproj", "{D86C137A-5F35-426A-B524-B1B77475079E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogoFX.Client.Core.Specs", "LogoFX.Client.Core.Specs\LogoFX.Client.Core.Specs.csproj", "{DB30AC69-D8F7-4823-9860-D3640A2FFFDE}"
Expand All @@ -53,7 +51,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogoFX.Client.Core.Specs.Co
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogoFX.Core.Specs", "LogoFX.Core.Specs\LogoFX.Core.Specs.csproj", "{DF5B56B9-783A-457F-B8E1-EEA9EE033E91}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogoFX.Core.Specs.Common", "LogoFX.Core.Specs.Common\LogoFX.Core.Specs.Common.csproj", "{C2C89A94-96B9-43DA-841C-3F78ED059DDF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogoFX.Core.Specs.Common", "LogoFX.Core.Specs.Common\LogoFX.Core.Specs.Common.csproj", "{C2C89A94-96B9-43DA-841C-3F78ED059DDF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -243,22 +241,6 @@ Global
{27C2028A-1934-447F-953D-A6E2CB2851E1}.Release|x64.Build.0 = Release|Any CPU
{27C2028A-1934-447F-953D-A6E2CB2851E1}.Release|x86.ActiveCfg = Release|Any CPU
{27C2028A-1934-447F-953D-A6E2CB2851E1}.Release|x86.Build.0 = Release|Any CPU
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Debug|ARM.ActiveCfg = Debug|ARM
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Debug|ARM.Build.0 = Debug|ARM
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Debug|x64.ActiveCfg = Debug|x64
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Debug|x64.Build.0 = Debug|x64
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Debug|x86.ActiveCfg = Debug|x86
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Debug|x86.Build.0 = Debug|x86
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Release|Any CPU.Build.0 = Release|Any CPU
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Release|ARM.ActiveCfg = Release|ARM
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Release|ARM.Build.0 = Release|ARM
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Release|x64.ActiveCfg = Release|x64
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Release|x64.Build.0 = Release|x64
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Release|x86.ActiveCfg = Release|x86
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E}.Release|x86.Build.0 = Release|x86
{D86C137A-5F35-426A-B524-B1B77475079E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D86C137A-5F35-426A-B524-B1B77475079E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D86C137A-5F35-426A-B524-B1B77475079E}.Debug|ARM.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -435,7 +417,6 @@ Global
{72273E62-3C6E-4E51-A8A8-E8E36BC35D59} = {F555D153-CB40-4452-B5E4-E9731566272E}
{8B8AF219-8F81-49D1-8273-9572DD2A534D} = {F555D153-CB40-4452-B5E4-E9731566272E}
{27C2028A-1934-447F-953D-A6E2CB2851E1} = {F555D153-CB40-4452-B5E4-E9731566272E}
{11FF7F23-9E17-48A8-9F8F-C3C65E4F7C7E} = {F555D153-CB40-4452-B5E4-E9731566272E}
{D86C137A-5F35-426A-B524-B1B77475079E} = {F555D153-CB40-4452-B5E4-E9731566272E}
{DB30AC69-D8F7-4823-9860-D3640A2FFFDE} = {F555D153-CB40-4452-B5E4-E9731566272E}
{8D007164-EF51-440C-87DA-B8FAB2D6EB12} = {AF1E25E6-1B96-45E1-ABD5-A55169DC3497}
Expand Down

0 comments on commit 96d9670

Please sign in to comment.