System.IO.IsolatedStorage.IsolatedStorageFile.Remove C# (CSharp) Method

Remove() public static method

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);
            }
        }

Same methods

IsolatedStorageFile::Remove ( ) : void
IsolatedStorageFile::Remove ( System scope ) : void

Usage Example

Esempio n. 1
0
 public void DeleteFile_ThrowsIsolatedStorageException()
 {
     using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
     {
         isf.Remove();
         Assert.Throws <IsolatedStorageException>(() => isf.DeleteFile("foo"));
     }
 }
All Usage Examples Of System.IO.IsolatedStorage.IsolatedStorageFile::Remove