From c0e1203313b67e7f24085bcddb03986310999f0f Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Fri, 23 Mar 2018 17:18:25 -0700 Subject: [PATCH] Scaffold isolated storage to enable UriImageSources This is a broken implementation that is only enough to enable URI images. Fixes #104 --- Ooui.Forms/Forms.cs | 2 +- Ooui.Forms/LocalIsolatedStorageFile.cs | 40 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 Ooui.Forms/LocalIsolatedStorageFile.cs diff --git a/Ooui.Forms/Forms.cs b/Ooui.Forms/Forms.cs index a10929f..7e87aa3 100644 --- a/Ooui.Forms/Forms.cs +++ b/Ooui.Forms/Forms.cs @@ -96,7 +96,7 @@ namespace Xamarin.Forms public IIsolatedStorageFile GetUserStoreForApplication () { - throw new NotImplementedException (); + return new LocalIsolatedStorageFile (); } public void OpenUriAction (Uri uri) diff --git a/Ooui.Forms/LocalIsolatedStorageFile.cs b/Ooui.Forms/LocalIsolatedStorageFile.cs new file mode 100644 index 0000000..0d8650c --- /dev/null +++ b/Ooui.Forms/LocalIsolatedStorageFile.cs @@ -0,0 +1,40 @@ +using System; +using System.IO; +using System.Threading.Tasks; +using Xamarin.Forms.Internals; + +namespace Ooui.Forms +{ + public class LocalIsolatedStorageFile : IIsolatedStorageFile + { + public Task CreateDirectoryAsync (string path) + { + return Task.FromResult (null); + } + + public Task GetDirectoryExistsAsync (string path) + { + return Task.FromResult (true); + } + + public Task GetFileExistsAsync (string path) + { + return Task.FromResult (false); + } + + public Task GetLastWriteTimeAsync (string path) + { + throw new NotSupportedException (); + } + + public Task OpenFileAsync (string path, Xamarin.Forms.Internals.FileMode mode, Xamarin.Forms.Internals.FileAccess access) + { + throw new NotSupportedException (); + } + + public Task OpenFileAsync (string path, Xamarin.Forms.Internals.FileMode mode, Xamarin.Forms.Internals.FileAccess access, Xamarin.Forms.Internals.FileShare share) + { + throw new NotSupportedException (); + } + } +}