Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Commit

Permalink
-Restructured all Platform Specific libraries into a single multi-tar…
Browse files Browse the repository at this point in the history
…geted project called PlatformBindings-Platform.

-The Initialisation has changed, now instead of calling an AppServices class, you call PlatformBindingsBootstrapper.Initialise().

-Updated documentation.

-Removed iOS and Xamarin Forms for the time being.
  • Loading branch information
WilliamABradley committed Jan 7, 2018
1 parent 18d5043 commit 186b6b2
Show file tree
Hide file tree
Showing 117 changed files with 219 additions and 642 deletions.
22 changes: 0 additions & 22 deletions Android/PlatformBindings-Android.csproj

This file was deleted.

12 changes: 0 additions & 12 deletions Android/Resources/Resource.Designer.cs

This file was deleted.

24 changes: 0 additions & 24 deletions Console/PlatformBindings-Console.csproj

This file was deleted.

2 changes: 1 addition & 1 deletion Core/AppServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace PlatformBindings
/// </summary>
public abstract class AppServices
{
public AppServices(bool HasUI, Platform Platform)
protected AppServices(bool HasUI, Platform Platform)
{
Current = this;
this.HasUI = HasUI;
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
<PackageProjectUrl>https://github.com/WilliamABradley/PlatformBindingsFramework</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/WilliamABradley/PlatformBindingsFramework/blob/master/LICENSE</PackageLicenseUrl>
<Copyright>Copyright © William Bradley 2017</Copyright>
<!-- Project States -->
<IsUwpProject>$(MSBuildProjectName.Contains('UWP'))</IsUwpProject>
<IsAndroidProject>$(MSBuildProjectName.Contains('Android'))</IsAndroidProject>
<!-- UWP Config -->
<UwpMetaPackageVersion>6.0.5</UwpMetaPackageVersion>
<DefaultTargetPlatformVersion>16299</DefaultTargetPlatformVersion>
<DefaultTargetPlatformMinVersion>14393</DefaultTargetPlatformMinVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
26 changes: 0 additions & 26 deletions Directory.Build.targets

This file was deleted.

20 changes: 0 additions & 20 deletions NETCore/PlatformBindings-NETCore.csproj

This file was deleted.

77 changes: 77 additions & 0 deletions Platform/PlatformBindings-Platform.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.4;netstandard2.0;net461;uap10.0;monoandroid80</TargetFrameworks>
<RootNamespace>PlatformBindings</RootNamespace>
<AssemblyName>PlatformBindings</AssemblyName>
<Title>PlatformBindings</Title>
<Description>Operating System Library for the .NET Platform Bindings Framework</Description>
<PackageTags>.NET CrossPlatform PlatformBindings .NETPlatformBindingsFramework .NETPlatformBindings</PackageTags>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<!-- Platform Definitions -->

<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>WIN32</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>NETCore</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<DefineConstants>UWP</DefineConstants>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'monoandroid80'">
<DefineConstants>ANDROID</DefineConstants>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<DevInstrumentationEnabled>True</DevInstrumentationEnabled>
<AndroidResgenFile>Platforms\Android\Resources\Resource.Designer.cs</AndroidResgenFile>
</PropertyGroup>

<!-- Platform Requirements -->

<ItemGroup>
<Compile Remove="Platforms\**\*.*" />
<None Include="Platforms\**\*.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Compile Include="Platforms\Win32\**\*.cs" />
<Compile Include="Platforms\NETCore\**\*.cs" />
<PackageReference Include="Ookii.Dialogs" Version="1.0.0" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Compile Include="Platforms\NETCore\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<Compile Include="Platforms\UWP\**\*.cs" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.0.5" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'MonoAndroid80'">
<Compile Include="Platforms\Android\**\*.cs" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="26.1.0.1" />
</ItemGroup>

<!-- End of Platform Definitions -->

<ItemGroup>
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Core\PlatformBindings-Core.csproj" />
</ItemGroup>

<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
</Project>
22 changes: 17 additions & 5 deletions iOS/IOSAppServices.cs → Platform/PlatformBindingsBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,31 @@
// ******************************************************************

using System;
using PlatformBindings.Enums;

namespace PlatformBindings
{
public class IOSAppServices : AppServices
public static class PlatformBindingsBootstrapper
{
public IOSAppServices(bool HasUI) : base(HasUI, Platform.iOS)
public static void Initialise(bool HasUI)
{
#if UWP
new UWPAppServices(HasUI);
#elif ANDROID
new AndroidAppServices(HasUI);
#elif WIN32
new Win32AppServices(HasUI);
#elif NETCore
new NETCoreServices(HasUI);
#else
throw new NotImplementedException("This platform isn't supported yet.");
#endif
}

public override Version GetAppVersion()
#if UWP
public static void AttachDispatcher(Windows.UI.Core.CoreDispatcher Dispatcher)
{
throw new NotImplementedException();
((UWPAppServices)AppServices.Current).AttachDispatcher(Dispatcher);
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace PlatformBindings
{
public class AndroidAppServices : AppServices
{
public AndroidAppServices(bool HasUI, bool UseAppCompatUI) : this(HasUI)
internal AndroidAppServices(bool HasUI, bool UseAppCompatUI) : this(HasUI)
{
AndroidAppServices.UseAppCompatUI = UseAppCompatUI;
}
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace PlatformBindings
{
public class NETCoreServices : AppServices
{
public NETCoreServices() : base(true, Enums.Platform.NETCore)
internal NETCoreServices(bool HasUI) : base(HasUI, Enums.Platform.NETCore)
{
IO = new CoreIOBindings();
UI = new CoreUIBindings();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using PlatformBindings.Models;
using Windows.Security.Credentials;

namespace PlatformBindings.Services.Bindings
namespace PlatformBindings.Services
{
public class UWPCredentialManager : ICredentialManager
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using Windows.Security.Authentication.Web;
using PlatformBindings.Common;

namespace PlatformBindings.Services.Bindings
namespace PlatformBindings.Services
{
public class UWPOAuthBroker : IOAuthBroker
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using PlatformBindings.Services;
using Windows.UI.Core;
using Windows.ApplicationModel;
using PlatformBindings.Services.Bindings;
using PlatformBindings.Enums;

namespace PlatformBindings
Expand All @@ -24,7 +23,7 @@ namespace PlatformBindings
/// </summary>
public class UWPAppServices : AppServices
{
public UWPAppServices(bool HasUI) : base(HasUI, Platform.UWP)
internal UWPAppServices(bool HasUI) : base(HasUI, Platform.UWP)
{
IO = new UWPIOBindings();
Credentials = new UWPCredentialManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ookii.Dialogs.Wpf;
Expand Down Expand Up @@ -113,6 +111,8 @@ public override Task<FileContainer> SaveFile(FileSavePickerProperties Properties
using (var dialog = new SaveFileDialog())
{
ConfigureDialog(dialog, Properties);
dialog.OverwritePrompt = true;
dialog.CheckPathExists = true;
if (Properties != null)
{
if (!string.IsNullOrWhiteSpace(Properties.SuggestedName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace PlatformBindings
{
public class Win32AppServices : AppServices
{
public Win32AppServices(bool HasUI) : base(HasUI, Platform.Win32)
internal Win32AppServices(bool HasUI) : base(HasUI, Platform.Win32)
{
IO = new Win32IOBindings();
}
Expand Down
Loading

0 comments on commit 186b6b2

Please sign in to comment.