Skip to content

Commit

Permalink
Added link to Util functions in WP7 - added a function for checking t…
Browse files Browse the repository at this point in the history
…ime of last logical write to file (Silverlight only.)
  • Loading branch information
Aaronontheweb committed Jan 11, 2011
1 parent 1717e0b commit 7b1a1f8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Expand Up @@ -61,6 +61,9 @@
<Compile Include="..\IsolatedStorageExtensions\IsolatedStorageHelper.Read.Xml.cs">
<Link>IsolatedStorageHelper.Read.Xml.cs</Link>
</Compile>
<Compile Include="..\IsolatedStorageExtensions\IsolatedStorageHelper.Util.cs">
<Link>IsolatedStorageHelper.Util.cs</Link>
</Compile>
<Compile Include="..\IsolatedStorageExtensions\IsolatedStorageHelper.Write.cs">
<Link>IsolatedStorageHelper.Write.cs</Link>
</Compile>
Expand Down
21 changes: 21 additions & 0 deletions IsolatedStorageExtensions/IsolatedStorageHelper.Read.cs
Expand Up @@ -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)
Expand Down

0 comments on commit 7b1a1f8

Please sign in to comment.