From 7b1a1f86af00b7acbeae45aec0be6d7c4f1cc0d0 Mon Sep 17 00:00:00 2001 From: Aaronontheweb Date: Tue, 11 Jan 2011 00:08:47 -0800 Subject: [PATCH] Added link to Util functions in WP7 - added a function for checking time of last logical write to file (Silverlight only.) --- .../IsolatedStorageExtensions.Mobile.csproj | 3 +++ .../IsolatedStorageHelper.Read.cs | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/IsolatedStorageExtensions.Mobile/IsolatedStorageExtensions.Mobile.csproj b/IsolatedStorageExtensions.Mobile/IsolatedStorageExtensions.Mobile.csproj index 30f44c2..8b12dc1 100644 --- a/IsolatedStorageExtensions.Mobile/IsolatedStorageExtensions.Mobile.csproj +++ b/IsolatedStorageExtensions.Mobile/IsolatedStorageExtensions.Mobile.csproj @@ -61,6 +61,9 @@ IsolatedStorageHelper.Read.Xml.cs + + IsolatedStorageHelper.Util.cs + IsolatedStorageHelper.Write.cs diff --git a/IsolatedStorageExtensions/IsolatedStorageHelper.Read.cs b/IsolatedStorageExtensions/IsolatedStorageHelper.Read.cs index e700501..ccd44cc 100644 --- a/IsolatedStorageExtensions/IsolatedStorageHelper.Read.cs +++ b/IsolatedStorageExtensions/IsolatedStorageHelper.Read.cs @@ -33,6 +33,27 @@ public static bool FileExists(string filepath, IsolatedStorageFile storage) #endregion + #region File Age + +#if !WINDOWS_PHONE + + public static DateTimeOffset GetFileAge(string filepath) + { + using(var storage = IsolatedStorageFile.GetUserStoreForApplication()) + { + return GetFileAge(filepath, storage); + } + } + + public static DateTimeOffset GetFileAge(string filepath, IsolatedStorageFile storage) + { + return storage.GetLastWriteTime(filepath); + } + +#endif + + #endregion + #region Stream methods public static Stream GetFileStream(string filepath, IsolatedStorageFile storage)