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

Commit

Permalink
-Added support for Win32/.NET Framework, currently only supporting IO…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
WilliamABradley committed Jan 7, 2018
1 parent 670c923 commit 568bb83
Show file tree
Hide file tree
Showing 32 changed files with 1,027 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Android/PlatformBindings-Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.1.0" />
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.2.0" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="26.1.0.1" />
</ItemGroup>

Expand Down
6 changes: 6 additions & 0 deletions Android/Services/AndroidFileSystemPickers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FileContainer> PickFile(FilePickerProperties Properties)
{
Expand Down Expand Up @@ -75,6 +76,11 @@ public override async Task<FolderContainer> PickFolder(FolderPickerProperties Pr
else return null;
}

public override Task<FileContainer> SaveFile(FileSavePickerProperties Properties)
{
throw new System.NotImplementedException();
}

private async Task<ActivityResult> CreateFilePicker(FilePickerProperties Properties, bool Multiple)
{
var activity = AndroidHelpers.GetCurrentActivity();
Expand Down
2 changes: 2 additions & 0 deletions Core/Enums/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ public enum Platform
{
UWP,
Android,
iOS,
Console,
NETCore,
Win32,
XamarinForms
}
}
10 changes: 10 additions & 0 deletions Core/Models/FileSystem/Pickers/FileSavePickerProperties.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace PlatformBindings.Models.FileSystem
{
public class FileSavePickerProperties : FilePickerProperties
{
/// <summary>
/// The Suggested name of the file to be saved.
/// </summary>
public string SuggestedName { get; set; }
}
}
25 changes: 23 additions & 2 deletions Core/Services/FileSystemPickers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@ namespace PlatformBindings.Services
public abstract class FileSystemPickers
{
/// <summary>
/// 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.
/// </summary>
public abstract bool SupportsPickFile { get; }

/// <summary>
/// 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.
/// </summary>
public abstract bool SupportsPickFolder { get; }

/// <summary>
/// Used to Determine if Saving Files is supported using a File Save Picker.
/// </summary>
public abstract bool SupportsSaveFile { get; }

/// <summary>
/// Opens a File Picker to Pick Files from the Operating System. See <see cref="SupportsPickFile"/> to ensure that this is Supported.
/// </summary>
Expand Down Expand Up @@ -78,5 +83,21 @@ public Task<FolderContainer> PickFolder()
/// <param name="Properties">Filters to narrow down the Observable Files.</param>
/// <returns>A Picked Folder, or <see cref="null"/> if Cancelled</returns>
public abstract Task<FolderContainer> PickFolder(FolderPickerProperties Properties);

/// <summary>
/// Opens a File Save Picker to save a file from the Operating System. See <see cref="SupportsPickFile"/> to ensure that this is Supported.
/// </summary>
/// <returns>A saved file, or <see cref="null"/> if Cancelled</returns>
public Task<FileContainer> SaveFile()
{
return SaveFile(null);
}

/// <summary>
/// Opens a File Save Picker to save a file from the Operating System. See <see cref="SupportsPickFile"/> to ensure that this is Supported.
/// </summary>
/// <param name="Properties">Properties for saving the file.</param>
/// <returns>A saved file, or <see cref="null"/> if Cancelled</returns>
public abstract Task<FileContainer> SaveFile(FileSavePickerProperties Properties);
}
}
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<IsUwpProject>$(MSBuildProjectName.Contains('UWP'))</IsUwpProject>
<IsAndroidProject>$(MSBuildProjectName.Contains('Android'))</IsAndroidProject>
<!-- UWP Config -->
<UwpMetaPackageVersion>6.0.1</UwpMetaPackageVersion>
<UwpMetaPackageVersion>6.0.5</UwpMetaPackageVersion>
<DefaultTargetPlatformVersion>16299</DefaultTargetPlatformVersion>
<DefaultTargetPlatformMinVersion>14393</DefaultTargetPlatformMinVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="2.0.41" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="2.1.11" PrivateAssets="all" />
</ItemGroup>

<!-- https://github.com/NuGet/Home/issues/4337 -->
Expand Down
2 changes: 1 addition & 1 deletion NETCore/PlatformBindings-NETCore.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>PlatformBindings</RootNamespace>
<Title>PlatformBindings-NETCore</Title>
<Description>.NET Core Head for the .NET Platform Bindings Framework</Description>
Expand Down
108 changes: 82 additions & 26 deletions PlatformBindingsFramework.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion TestApps/Tests-Universal/Tests/CredentialTestPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
})
Expand Down
35 changes: 35 additions & 0 deletions TestApps/Tests-Universal/Tests/PickerTestPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion TestApps/UWP/Test-UWP/Test-UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.0.1</Version>
<Version>6.0.5</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
Expand Down
6 changes: 6 additions & 0 deletions TestApps/WPF/Test-WPF/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
Loading

0 comments on commit 568bb83

Please sign in to comment.