public static Remove ( IsolatedStorageScope scope ) : void | ||
scope | IsolatedStorageScope | |
return | void |
public static void Remove(IsolatedStorageScope scope)
{
// The static Remove() deletes ALL IsoStores for the given scope
VerifyGlobalScope(scope);
string root = Helper.GetRootDirectory(scope);
try
{
Directory.Delete(root, recursive: true);
Directory.CreateDirectory(root);
}
catch
{
throw new IsolatedStorageException(SR.IsolatedStorage_DeleteDirectories);
}
}
public void DeleteFile_ThrowsIsolatedStorageException() { using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly()) { isf.Remove(); Assert.Throws <IsolatedStorageException>(() => isf.DeleteFile("foo")); } }