v4

Rating: No reviews yet
Downloads: 75
Change Set: 4b46f0f580e9
Released: Sep 4, 2012
Updated: Sep 4, 2012 by jamiet
Dev status: Stable Help Icon

Recommended Download

Application WinRtUtility.dll
application, 7K, uploaded Sep 4, 2012 - 75 downloads

Release Notes

Please note that this release is not backwards compatible with previous releases because I have changed the name of the file that stores the instance of T. The reason for this change was that previously the filenames could end up being too long and thus throw an error.

New method overloads to allow specification of a handle for the saved object thus supporting the saving of multiple instances of T.

Code below demonstrates this new capability:
[TestMethod]
public async Task SaveAndLoadTwoObjectsOfSameTypeUsingDifferentHandles()
{
    //Declare two instances of the same type. Notice how we only have one instance of ObjectStorageHelper<T>
    var poco = new Poco() { IntProp = 1, StringProp = "one" };
    var anotherPoco = new Poco() { IntProp = 2, StringProp = "two" };
    var osh = new ObjectStorageHelper<Poco>(StorageType.Local);

    //Store them both then retrieve them both. In each case, use a different handle.
    await osh.SaveAsync(poco, handle);
    await osh.SaveAsync(anotherPoco, handle2);
    var result = await osh.LoadAsync(handle);
    var anotherResult = await osh.LoadAsync(handle2);

    //Check that the second call to SaveASync() did not overwrite the object saved by first call to SaveAsync()
    Assert.AreEqual(poco, result);
    Assert.AreEqual(anotherPoco, anotherResult);
}


Also added XML documentation comments. Which is nice.

Reviews for this release

No reviews yet for this release.