From 568bb839dd106d6252b5fe7c280452ab166d6efc Mon Sep 17 00:00:00 2001 From: William Bradley Date: Sun, 7 Jan 2018 16:24:12 +1300 Subject: [PATCH] -Added support for Win32/.NET Framework, currently only supporting IO and FileSystemPickers. -Added iOS enum to Platform, fixed base IOSAppServices. -NETCore Library is now netstandard2.0. -Added methods for Save file pickers, added UWP and Win32 implementation, Android will require an external library or custom implementation. -Added Save and Ext Filter tests. -Added basic WPF Test App. -Fixed bug in UWP File Pickers with unspecified starting location. --- Android/PlatformBindings-Android.csproj | 2 +- Android/Services/AndroidFileSystemPickers.cs | 6 + Core/Enums/Platform.cs | 2 + .../Pickers/FileSavePickerProperties.cs | 10 + Core/Services/FileSystemPickers.cs | 25 ++- Directory.Build.props | 4 +- NETCore/PlatformBindings-NETCore.csproj | 2 +- PlatformBindingsFramework.sln | 108 ++++++++--- .../Tests/CredentialTestPage.cs | 2 +- .../Tests-Universal/Tests/PickerTestPage.cs | 35 ++++ TestApps/UWP/Test-UWP/Test-UWP.csproj | 2 +- TestApps/WPF/Test-WPF/App.config | 6 + TestApps/WPF/Test-WPF/Form1.Designer.cs | 61 ++++++ TestApps/WPF/Test-WPF/Form1.cs | 34 ++++ TestApps/WPF/Test-WPF/Form1.resx | 120 ++++++++++++ TestApps/WPF/Test-WPF/Program.cs | 25 +++ .../WPF/Test-WPF/Properties/AssemblyInfo.cs | 23 +++ .../Test-WPF/Properties/Resources.Designer.cs | 71 +++++++ .../WPF/Test-WPF/Properties/Resources.resx | 117 ++++++++++++ .../Test-WPF/Properties/Settings.Designer.cs | 30 +++ .../WPF/Test-WPF/Properties/Settings.settings | 7 + TestApps/WPF/Test-WPF/Test-WPF.csproj | 92 +++++++++ UWP/PlatformBindings-UWP.csproj | 6 +- UWP/Services/UWPFileSystemPickers.cs | 43 ++++- Win32/PlatformBindings-Win32.csproj | 22 +++ Win32/Services/Win32FileSystemPickers.cs | 178 ++++++++++++++++++ Win32/Services/Win32IOBindings.cs | 7 + Win32/Win32AppServices.cs | 19 ++ .../PlatformBindings-XamarinForms.csproj | 2 +- _build/build.cake | 3 +- iOS/IOSAppServices.cs | 2 +- version.json | 2 +- 32 files changed, 1027 insertions(+), 41 deletions(-) create mode 100644 Core/Models/FileSystem/Pickers/FileSavePickerProperties.cs create mode 100644 TestApps/WPF/Test-WPF/App.config create mode 100644 TestApps/WPF/Test-WPF/Form1.Designer.cs create mode 100644 TestApps/WPF/Test-WPF/Form1.cs create mode 100644 TestApps/WPF/Test-WPF/Form1.resx create mode 100644 TestApps/WPF/Test-WPF/Program.cs create mode 100644 TestApps/WPF/Test-WPF/Properties/AssemblyInfo.cs create mode 100644 TestApps/WPF/Test-WPF/Properties/Resources.Designer.cs create mode 100644 TestApps/WPF/Test-WPF/Properties/Resources.resx create mode 100644 TestApps/WPF/Test-WPF/Properties/Settings.Designer.cs create mode 100644 TestApps/WPF/Test-WPF/Properties/Settings.settings create mode 100644 TestApps/WPF/Test-WPF/Test-WPF.csproj create mode 100644 Win32/PlatformBindings-Win32.csproj create mode 100644 Win32/Services/Win32FileSystemPickers.cs create mode 100644 Win32/Services/Win32IOBindings.cs create mode 100644 Win32/Win32AppServices.cs diff --git a/Android/PlatformBindings-Android.csproj b/Android/PlatformBindings-Android.csproj index 4226e86..f43f815 100644 --- a/Android/PlatformBindings-Android.csproj +++ b/Android/PlatformBindings-Android.csproj @@ -10,7 +10,7 @@ - + diff --git a/Android/Services/AndroidFileSystemPickers.cs b/Android/Services/AndroidFileSystemPickers.cs index d064bcb..eaf9030 100644 --- a/Android/Services/AndroidFileSystemPickers.cs +++ b/Android/Services/AndroidFileSystemPickers.cs @@ -26,6 +26,7 @@ public class AndroidFileSystemPickers : FileSystemPickers { public override bool SupportsPickFile => true; public override bool SupportsPickFolder => true; + public override bool SupportsSaveFile => false; public override async Task PickFile(FilePickerProperties Properties) { @@ -75,6 +76,11 @@ public override async Task PickFolder(FolderPickerProperties Pr else return null; } + public override Task SaveFile(FileSavePickerProperties Properties) + { + throw new System.NotImplementedException(); + } + private async Task CreateFilePicker(FilePickerProperties Properties, bool Multiple) { var activity = AndroidHelpers.GetCurrentActivity(); diff --git a/Core/Enums/Platform.cs b/Core/Enums/Platform.cs index 6e422ce..ac72ee2 100644 --- a/Core/Enums/Platform.cs +++ b/Core/Enums/Platform.cs @@ -16,8 +16,10 @@ public enum Platform { UWP, Android, + iOS, Console, NETCore, + Win32, XamarinForms } } \ No newline at end of file diff --git a/Core/Models/FileSystem/Pickers/FileSavePickerProperties.cs b/Core/Models/FileSystem/Pickers/FileSavePickerProperties.cs new file mode 100644 index 0000000..0389778 --- /dev/null +++ b/Core/Models/FileSystem/Pickers/FileSavePickerProperties.cs @@ -0,0 +1,10 @@ +namespace PlatformBindings.Models.FileSystem +{ + public class FileSavePickerProperties : FilePickerProperties + { + /// + /// The Suggested name of the file to be saved. + /// + public string SuggestedName { get; set; } + } +} \ No newline at end of file diff --git a/Core/Services/FileSystemPickers.cs b/Core/Services/FileSystemPickers.cs index e0db48a..3dbf60a 100644 --- a/Core/Services/FileSystemPickers.cs +++ b/Core/Services/FileSystemPickers.cs @@ -22,15 +22,20 @@ namespace PlatformBindings.Services public abstract class FileSystemPickers { /// - /// Used to Determine if the OS Supports Picking Files using a File Picker. + /// Used to Determine if Picking Files is supported using a File Picker. /// public abstract bool SupportsPickFile { get; } /// - /// Used to Determine if the OS Supports Picking Folders using a Folder Picker. + /// Used to Determine if Picking Folders is supported using a Folder Picker. /// public abstract bool SupportsPickFolder { get; } + /// + /// Used to Determine if Saving Files is supported using a File Save Picker. + /// + public abstract bool SupportsSaveFile { get; } + /// /// Opens a File Picker to Pick Files from the Operating System. See to ensure that this is Supported. /// @@ -78,5 +83,21 @@ public Task PickFolder() /// Filters to narrow down the Observable Files. /// A Picked Folder, or if Cancelled public abstract Task PickFolder(FolderPickerProperties Properties); + + /// + /// Opens a File Save Picker to save a file from the Operating System. See to ensure that this is Supported. + /// + /// A saved file, or if Cancelled + public Task SaveFile() + { + return SaveFile(null); + } + + /// + /// Opens a File Save Picker to save a file from the Operating System. See to ensure that this is Supported. + /// + /// Properties for saving the file. + /// A saved file, or if Cancelled + public abstract Task SaveFile(FileSavePickerProperties Properties); } } \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index e022285..5c62af8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -12,13 +12,13 @@ $(MSBuildProjectName.Contains('UWP')) $(MSBuildProjectName.Contains('Android')) - 6.0.1 + 6.0.5 16299 14393 - + diff --git a/NETCore/PlatformBindings-NETCore.csproj b/NETCore/PlatformBindings-NETCore.csproj index 3c31ef8..fdda11f 100644 --- a/NETCore/PlatformBindings-NETCore.csproj +++ b/NETCore/PlatformBindings-NETCore.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + netstandard2.0 PlatformBindings PlatformBindings-NETCore .NET Core Head for the .NET Platform Bindings Framework diff --git a/PlatformBindingsFramework.sln b/PlatformBindingsFramework.sln index 7177f35..08f03b0 100644 --- a/PlatformBindingsFramework.sln +++ b/PlatformBindingsFramework.sln @@ -33,12 +33,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NETCore", "NETCore", "{7B5B EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test-NETCore", "TestApps\NETCore\Test-NETCore.csproj", "{8D084D1C-3C66-49DC-B90A-8BA0A27248BA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlatformBindings-iOS", "IOS\PlatformBindings-iOS.csproj", "{CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "iOS", "iOS", "{E9D07B9B-7F31-49C8-BD6A-BDCB3DD238FE}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test-iOS", "TestApps\iOS\Test-iOS\Test-iOS.csproj", "{ED196E92-54F1-40C2-B056-F77FB87F9D45}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlatformBindings-Win32", "Win32\PlatformBindings-Win32.csproj", "{CE25568C-58C2-466E-BCFC-92C372D70516}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WPF", "WPF", "{B8FFCE56-0350-4D41-A4EB-88EC41923B17}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test-WPF", "TestApps\WPF\Test-WPF\Test-WPF.csproj", "{EE351C47-F5B0-4BC0-A361-6A4F7F112557}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlatformBindings-iOS", "iOS\PlatformBindings-iOS.csproj", "{D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -331,30 +337,6 @@ Global {8D084D1C-3C66-49DC-B90A-8BA0A27248BA}.Release|x64.Build.0 = Release|Any CPU {8D084D1C-3C66-49DC-B90A-8BA0A27248BA}.Release|x86.ActiveCfg = Release|Any CPU {8D084D1C-3C66-49DC-B90A-8BA0A27248BA}.Release|x86.Build.0 = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|ARM.ActiveCfg = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|ARM.Build.0 = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|iPhone.Build.0 = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|x64.ActiveCfg = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|x64.Build.0 = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|x86.ActiveCfg = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Debug|x86.Build.0 = Debug|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|Any CPU.Build.0 = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|ARM.ActiveCfg = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|ARM.Build.0 = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|iPhone.ActiveCfg = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|iPhone.Build.0 = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|x64.ActiveCfg = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|x64.Build.0 = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|x86.ActiveCfg = Release|Any CPU - {CD2A262A-66CB-4FE1-A8CB-F0EB34DC8296}.Release|x86.Build.0 = Release|Any CPU {ED196E92-54F1-40C2-B056-F77FB87F9D45}.Debug|Any CPU.ActiveCfg = Debug|iPhone {ED196E92-54F1-40C2-B056-F77FB87F9D45}.Debug|ARM.ActiveCfg = Debug|iPhone {ED196E92-54F1-40C2-B056-F77FB87F9D45}.Debug|iPhone.ActiveCfg = Debug|iPhone @@ -371,6 +353,78 @@ Global {ED196E92-54F1-40C2-B056-F77FB87F9D45}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator {ED196E92-54F1-40C2-B056-F77FB87F9D45}.Release|x64.ActiveCfg = Release|iPhone {ED196E92-54F1-40C2-B056-F77FB87F9D45}.Release|x86.ActiveCfg = Release|iPhone + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|ARM.ActiveCfg = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|ARM.Build.0 = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|iPhone.Build.0 = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|x64.ActiveCfg = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|x64.Build.0 = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|x86.ActiveCfg = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Debug|x86.Build.0 = Debug|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|Any CPU.Build.0 = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|ARM.ActiveCfg = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|ARM.Build.0 = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|iPhone.ActiveCfg = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|iPhone.Build.0 = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|x64.ActiveCfg = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|x64.Build.0 = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|x86.ActiveCfg = Release|Any CPU + {CE25568C-58C2-466E-BCFC-92C372D70516}.Release|x86.Build.0 = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|ARM.ActiveCfg = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|ARM.Build.0 = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|iPhone.Build.0 = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|x64.ActiveCfg = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|x64.Build.0 = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|x86.ActiveCfg = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Debug|x86.Build.0 = Debug|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|Any CPU.Build.0 = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|ARM.ActiveCfg = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|ARM.Build.0 = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|iPhone.ActiveCfg = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|iPhone.Build.0 = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|x64.ActiveCfg = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|x64.Build.0 = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|x86.ActiveCfg = Release|Any CPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557}.Release|x86.Build.0 = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|ARM.ActiveCfg = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|ARM.Build.0 = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|iPhone.Build.0 = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|x64.ActiveCfg = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|x64.Build.0 = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|x86.ActiveCfg = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Debug|x86.Build.0 = Debug|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|Any CPU.Build.0 = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|ARM.ActiveCfg = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|ARM.Build.0 = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|iPhone.ActiveCfg = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|iPhone.Build.0 = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|x64.ActiveCfg = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|x64.Build.0 = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|x86.ActiveCfg = Release|Any CPU + {D0D6DEC8-B5F7-46F2-B279-6598D5834DD5}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -385,6 +439,8 @@ Global {8D084D1C-3C66-49DC-B90A-8BA0A27248BA} = {7B5B14B7-0E13-425C-9951-CF4B8D62E283} {E9D07B9B-7F31-49C8-BD6A-BDCB3DD238FE} = {5004EF8D-9B09-4468-BDE1-2F1455C2FAAE} {ED196E92-54F1-40C2-B056-F77FB87F9D45} = {E9D07B9B-7F31-49C8-BD6A-BDCB3DD238FE} + {B8FFCE56-0350-4D41-A4EB-88EC41923B17} = {5004EF8D-9B09-4468-BDE1-2F1455C2FAAE} + {EE351C47-F5B0-4BC0-A361-6A4F7F112557} = {B8FFCE56-0350-4D41-A4EB-88EC41923B17} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F29D3568-CA96-478E-B0F4-76698467FEF6} diff --git a/TestApps/Tests-Universal/Tests/CredentialTestPage.cs b/TestApps/Tests-Universal/Tests/CredentialTestPage.cs index 38a8755..be012da 100644 --- a/TestApps/Tests-Universal/Tests/CredentialTestPage.cs +++ b/TestApps/Tests-Universal/Tests/CredentialTestPage.cs @@ -52,7 +52,7 @@ public CredentialTestPage(ITestPageGenerator PageGenerator) : base("Credential T { return "Success"; } - else return "Credential Storage Failed: Retrieved Credential Malformed"; + else return "Credential Storage Failed: Retrieved Credential Malformed or Incorrect"; } return "Credential Storage Failed"; }) diff --git a/TestApps/Tests-Universal/Tests/PickerTestPage.cs b/TestApps/Tests-Universal/Tests/PickerTestPage.cs index bd831fb..315e757 100644 --- a/TestApps/Tests-Universal/Tests/PickerTestPage.cs +++ b/TestApps/Tests-Universal/Tests/PickerTestPage.cs @@ -13,6 +13,7 @@ using PlatformBindings; using PlatformBindings.Enums; using PlatformBindings.Exceptions; +using PlatformBindings.Models.FileSystem; using System; using System.Threading.Tasks; using Tests.TestGenerator; @@ -102,6 +103,40 @@ public PickerTestPage(ITestPageGenerator PageGenerator) : base("Picker Tests", P else return PickerCancelled; }) }); + + AddTestItem(new TestTask + { + Name = "Save File W/ Ext Filters", + Test = context => Task.Run(async () => + { + var props = new FileSavePickerProperties(); + props.FileTypes.Add("*"); + props.FileTypes.Add(".mkv"); + props.FileTypes.Add(".wmv"); + props.StartingLocation = PathRoot.Application; + + var result = await AppServices.Current.IO.Pickers.SaveFile(props); + + return result?.Path; + }) + }); + + AddTestItem(new TestTask + { + Name = "Open File W/ Ext Filters", + Test = context => Task.Run(async () => + { + var props = new FilePickerProperties(); + props.FileTypes.Add("*"); + props.FileTypes.Add(".mkv"); + props.FileTypes.Add(".wmv"); + props.StartingLocation = PathRoot.Application; + + var result = await AppServices.Current.IO.Pickers.PickFile(props); + + return result?.Path; + }) + }); } private string PickerCancelled => "Picker Cancelled"; diff --git a/TestApps/UWP/Test-UWP/Test-UWP.csproj b/TestApps/UWP/Test-UWP/Test-UWP.csproj index d798ba5..72bfd45 100644 --- a/TestApps/UWP/Test-UWP/Test-UWP.csproj +++ b/TestApps/UWP/Test-UWP/Test-UWP.csproj @@ -147,7 +147,7 @@ - 6.0.1 + 6.0.5 diff --git a/TestApps/WPF/Test-WPF/App.config b/TestApps/WPF/Test-WPF/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/TestApps/WPF/Test-WPF/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/TestApps/WPF/Test-WPF/Form1.Designer.cs b/TestApps/WPF/Test-WPF/Form1.Designer.cs new file mode 100644 index 0000000..85c7931 --- /dev/null +++ b/TestApps/WPF/Test-WPF/Form1.Designer.cs @@ -0,0 +1,61 @@ +namespace Test_WPF +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(57, 60); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 0; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 261); + this.Controls.Add(this.button1); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + } +} + diff --git a/TestApps/WPF/Test-WPF/Form1.cs b/TestApps/WPF/Test-WPF/Form1.cs new file mode 100644 index 0000000..2cb93a5 --- /dev/null +++ b/TestApps/WPF/Test-WPF/Form1.cs @@ -0,0 +1,34 @@ +using PlatformBindings; +using PlatformBindings.Models.FileSystem; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Test_WPF +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private async void button1_Click(object sender, EventArgs e) + { + var props = new FolderPickerProperties(); + props.FileTypes.Add("*"); + props.FileTypes.Add(".mkv"); + props.FileTypes.Add(".wmv"); + props.StartingLocation = PlatformBindings.Enums.PathRoot.Application; + + var result = await AppServices.Current.IO.Pickers.PickFolder(props); + var p = "as"; + } + } +} \ No newline at end of file diff --git a/TestApps/WPF/Test-WPF/Form1.resx b/TestApps/WPF/Test-WPF/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TestApps/WPF/Test-WPF/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestApps/WPF/Test-WPF/Program.cs b/TestApps/WPF/Test-WPF/Program.cs new file mode 100644 index 0000000..01582eb --- /dev/null +++ b/TestApps/WPF/Test-WPF/Program.cs @@ -0,0 +1,25 @@ +using PlatformBindings; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Test_WPF +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + private static void Main() + { + new Win32AppServices(true); + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} \ No newline at end of file diff --git a/TestApps/WPF/Test-WPF/Properties/AssemblyInfo.cs b/TestApps/WPF/Test-WPF/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9a6ca3a --- /dev/null +++ b/TestApps/WPF/Test-WPF/Properties/AssemblyInfo.cs @@ -0,0 +1,23 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Test-WPF")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Test-WPF")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ee351c47-f5b0-4bc0-a361-6a4f7f112557")] \ No newline at end of file diff --git a/TestApps/WPF/Test-WPF/Properties/Resources.Designer.cs b/TestApps/WPF/Test-WPF/Properties/Resources.Designer.cs new file mode 100644 index 0000000..e1728cb --- /dev/null +++ b/TestApps/WPF/Test-WPF/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Test_WPF.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test_WPF.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/TestApps/WPF/Test-WPF/Properties/Resources.resx b/TestApps/WPF/Test-WPF/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/TestApps/WPF/Test-WPF/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestApps/WPF/Test-WPF/Properties/Settings.Designer.cs b/TestApps/WPF/Test-WPF/Properties/Settings.Designer.cs new file mode 100644 index 0000000..065c6ba --- /dev/null +++ b/TestApps/WPF/Test-WPF/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Test_WPF.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/TestApps/WPF/Test-WPF/Properties/Settings.settings b/TestApps/WPF/Test-WPF/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/TestApps/WPF/Test-WPF/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/TestApps/WPF/Test-WPF/Test-WPF.csproj b/TestApps/WPF/Test-WPF/Test-WPF.csproj new file mode 100644 index 0000000..f71706d --- /dev/null +++ b/TestApps/WPF/Test-WPF/Test-WPF.csproj @@ -0,0 +1,92 @@ + + + + + Debug + AnyCPU + {EE351C47-F5B0-4BC0-A361-6A4F7F112557} + WinExe + Test_WPF + Test-WPF + v4.6.1 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {49819b4e-2d4e-4fab-ba80-4dd2fb2081cf} + PlatformBindings-Core + + + {ce25568c-58c2-466e-bcfc-92c372d70516} + PlatformBindings-Win32 + + + + \ No newline at end of file diff --git a/UWP/PlatformBindings-UWP.csproj b/UWP/PlatformBindings-UWP.csproj index e864bb3..57b9f8a 100644 --- a/UWP/PlatformBindings-UWP.csproj +++ b/UWP/PlatformBindings-UWP.csproj @@ -11,7 +11,7 @@ - + @@ -19,4 +19,8 @@ + + + + \ No newline at end of file diff --git a/UWP/Services/UWPFileSystemPickers.cs b/UWP/Services/UWPFileSystemPickers.cs index b867d43..b9c9ad6 100644 --- a/UWP/Services/UWPFileSystemPickers.cs +++ b/UWP/Services/UWPFileSystemPickers.cs @@ -25,6 +25,7 @@ public class UWPFileSystemPickers : FileSystemPickers { public override bool SupportsPickFile => true; public override bool SupportsPickFolder => true; + public override bool SupportsSaveFile => true; public override async Task PickFile(FilePickerProperties Properties) { @@ -62,7 +63,11 @@ public override async Task PickFolder(FolderPickerProperties Pr { picker.FileTypeFilter.Add(property); } - if (Properties.StartingLocation.HasValue) picker.SuggestedStartLocation = GetPickerLocation(Properties.StartingLocation); + if (Properties.StartingLocation.HasValue) + { + var location = GetPickerLocation(Properties.StartingLocation); + if (location != PickerLocationId.Unspecified) picker.SuggestedStartLocation = location; + } } if (Properties == null || !Properties.FileTypes.Any()) picker.FileTypeFilter.Add("*"); @@ -74,6 +79,36 @@ public override async Task PickFolder(FolderPickerProperties Pr return await waiter.Task; } + public override async Task SaveFile(FileSavePickerProperties Properties) + { + TaskCompletionSource waiter = new TaskCompletionSource(); + PlatformBindingHelpers.OnUIThread(async () => + { + FileSavePicker picker = new FileSavePicker(); + + if (Properties != null) + { + if (!string.IsNullOrWhiteSpace(Properties.SuggestedName)) + { + picker.SuggestedFileName = Properties.SuggestedName; + } + + if (Properties.FileTypes != null) + { + foreach (var filter in Properties.FileTypes.Where(ext => ext != "*")) + { + picker.FileTypeChoices.Add(filter, new string[] { filter }); + } + } + } + + var file = await picker.PickSaveFileAsync(); + waiter.TrySetResult(file != null ? new UWPFileContainer(file) : null); + }); + + return await waiter.Task; + } + private FileOpenPicker GetFilePicker(FilePickerProperties Properties = null) { FileOpenPicker picker = new FileOpenPicker(); @@ -83,7 +118,11 @@ private FileOpenPicker GetFilePicker(FilePickerProperties Properties = null) { picker.FileTypeFilter.Add(property); } - if (Properties.StartingLocation.HasValue) picker.SuggestedStartLocation = GetPickerLocation(Properties.StartingLocation); + if (Properties.StartingLocation.HasValue) + { + var location = GetPickerLocation(Properties.StartingLocation); + if (location != PickerLocationId.Unspecified) picker.SuggestedStartLocation = location; + } } if (Properties == null || !Properties.FileTypes.Any()) picker.FileTypeFilter.Add("*"); diff --git a/Win32/PlatformBindings-Win32.csproj b/Win32/PlatformBindings-Win32.csproj new file mode 100644 index 0000000..09fb8ee --- /dev/null +++ b/Win32/PlatformBindings-Win32.csproj @@ -0,0 +1,22 @@ + + + + net461 + PlatformBindings + + + + + + + + + + + + + + + + + diff --git a/Win32/Services/Win32FileSystemPickers.cs b/Win32/Services/Win32FileSystemPickers.cs new file mode 100644 index 0000000..bc5bdea --- /dev/null +++ b/Win32/Services/Win32FileSystemPickers.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Ookii.Dialogs.Wpf; +using PlatformBindings.Models.FileSystem; + +namespace PlatformBindings.Services +{ + public class Win32FileSystemPickers : FileSystemPickers + { + public override bool SupportsPickFile => true; + + public override bool SupportsPickFolder => true; + + public override bool SupportsSaveFile => true; + + public override async Task PickFile(FilePickerProperties Properties) + { + var result = await OpenPicker(Properties); + if (result != null) + { + return (FileContainer)result; + } + + return null; + } + + public override async Task> PickFiles(FilePickerProperties Properties) + { + var result = await OpenPicker(Properties, true); + if (result != null) + { + return (List)result; + } + + return null; + } + + private Task OpenPicker(FilePickerProperties Properties, bool Multi = false) + { + using (var dialog = new OpenFileDialog()) + { + object pickerresult = null; + dialog.CheckFileExists = true; + dialog.Multiselect = Multi; + + ConfigureDialog(dialog, Properties); + + var result = dialog.ShowDialog(); + if (result == DialogResult.OK) + { + if (Multi) + { + if (dialog.FileNames != null) + { + pickerresult = dialog.FileNames + .Select(item => new CoreFileContainer(item)) + .ToList(); + } + } + else + { + if (!string.IsNullOrWhiteSpace(dialog.FileName)) + { + pickerresult = new CoreFileContainer(dialog.FileName); + } + } + } + + return Task.FromResult(pickerresult); + } + } + + public override Task PickFolder(FolderPickerProperties Properties) + { + var dialog = new VistaFolderBrowserDialog(); + if (Properties != null) + { + if (Properties.StartingLocation != null) + { + dialog.SelectedPath = AppServices.Current.IO.GetBaseFolder(Properties.StartingLocation.Value).Path; + } + } + + FolderContainer pickerresult = null; + + var result = dialog.ShowDialog(); + if (result == true) + { + pickerresult = new CoreFolderContainer(dialog.SelectedPath); + } + + return Task.FromResult(pickerresult); + } + + public override Task SaveFile(FileSavePickerProperties Properties) + { + using (var dialog = new SaveFileDialog()) + { + ConfigureDialog(dialog, Properties); + if (Properties != null) + { + if (!string.IsNullOrWhiteSpace(Properties.SuggestedName)) + { + dialog.FileName = Properties.SuggestedName; + } + } + + FileContainer container = null; + + var result = dialog.ShowDialog(); + if (result == DialogResult.OK) + { + container = new CoreFileContainer(dialog.FileName); + } + + return Task.FromResult(container); + } + } + + private void ConfigureDialog(FileDialog Dialog, FilePickerProperties Properties) + { + if (Properties != null) + { + if (Properties.FileTypes != null) + { + var types = Properties.FileTypes + .Where(ext => ext != "*") + .Select(ext => "*" + ext) + .ToList(); + + string filters = string.Empty; + if (Dialog is OpenFileDialog) + { + if (Properties.FileTypes.Contains("*")) + { + filters = "All Files|*.*" + filters; + } + + if (types.Any()) + { + var all = string.Join(";", types); + + if (!string.IsNullOrWhiteSpace(filters)) + { + filters += "|"; + } + + filters += $"{all}|{all}"; + } + } + + if (types.Count > 1) + { + foreach (var filter in types) + { + if (!string.IsNullOrWhiteSpace(filters)) + { + filters += "|"; + } + filters += $"{filter}|{filter}"; + } + } + + Dialog.Filter = filters; + } + + if (Properties.StartingLocation != null) + { + Dialog.InitialDirectory = AppServices.Current.IO.GetBaseFolder(Properties.StartingLocation.Value).Path; + } + } + } + } +} \ No newline at end of file diff --git a/Win32/Services/Win32IOBindings.cs b/Win32/Services/Win32IOBindings.cs new file mode 100644 index 0000000..e4d5a16 --- /dev/null +++ b/Win32/Services/Win32IOBindings.cs @@ -0,0 +1,7 @@ +namespace PlatformBindings.Services +{ + public class Win32IOBindings : CoreIOBindings + { + public override FileSystemPickers Pickers => new Win32FileSystemPickers(); + } +} \ No newline at end of file diff --git a/Win32/Win32AppServices.cs b/Win32/Win32AppServices.cs new file mode 100644 index 0000000..fcd54c1 --- /dev/null +++ b/Win32/Win32AppServices.cs @@ -0,0 +1,19 @@ +using System; +using PlatformBindings.Enums; +using PlatformBindings.Services; + +namespace PlatformBindings +{ + public class Win32AppServices : AppServices + { + public Win32AppServices(bool HasUI) : base(HasUI, Platform.Win32) + { + IO = new Win32IOBindings(); + } + + public override Version GetAppVersion() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/XamarinForms/PlatformBindings-XamarinForms.csproj b/XamarinForms/PlatformBindings-XamarinForms.csproj index cf32eea..eecc7c9 100644 --- a/XamarinForms/PlatformBindings-XamarinForms.csproj +++ b/XamarinForms/PlatformBindings-XamarinForms.csproj @@ -14,7 +14,7 @@ - + diff --git a/_build/build.cake b/_build/build.cake index 7e860e4..986f464 100644 --- a/_build/build.cake +++ b/_build/build.cake @@ -21,7 +21,7 @@ var toolsDir = buildDir + "/tools"; var Solution = baseDir + "/PlatformBindingsFramework.sln"; var nupkgDir = buildDir + "/nupkg"; -var gitVersioningVersion = "2.0.41"; +var gitVersioningVersion = "2.1.11"; var versionClient = toolsDir + "/nerdbank.gitversioning/tools/Get-Version.ps1"; string Version = null; @@ -92,6 +92,7 @@ Task("Verify") .Does(() => { VerifyHeaders(false); + NuGetRestore(Solution); }); Task("Version") diff --git a/iOS/IOSAppServices.cs b/iOS/IOSAppServices.cs index f290f2e..106c22b 100644 --- a/iOS/IOSAppServices.cs +++ b/iOS/IOSAppServices.cs @@ -17,7 +17,7 @@ namespace PlatformBindings { public class IOSAppServices : AppServices { - public IOSAppServices(bool HasUI, Platform Platform) : base(HasUI, Platform) + public IOSAppServices(bool HasUI) : base(HasUI, Platform.iOS) { } diff --git a/version.json b/version.json index 540c55f..632d51c 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "0.2.10-alpha", + "version": "0.2.11-alpha", "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master "^refs/heads/v\\d+\\.\\d+" // we also release branches starting with vN.N