Close() публичный Метод

public Close ( ) : void
Результат void
Пример #1
0
 public void DeleteClosedFile_ThrowsInvalidOperationException()
 {
     using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
     {
         isf.Close();
         Assert.Throws <InvalidOperationException>(() => isf.DeleteFile("foo"));
     }
 }
Пример #2
0
 public void MoveDirectory_Closed_ThrowsInvalidOperationException()
 {
     using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
     {
         isf.Close();
         Assert.Throws <InvalidOperationException>(() => isf.MoveDirectory("foo", "bar"));
     }
 }
Пример #3
0
 public void GetCreationTime_Closed_ThrowsInvalidOperationException()
 {
     using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
     {
         isf.Close();
         Assert.Throws <InvalidOperationException>(() => isf.GetCreationTime("foo"));
     }
 }
Пример #4
0
 public void DirectoryExists_ThrowsInvalidOperationException()
 {
     using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
     {
         isf.Close();
         Assert.Throws <InvalidOperationException>(() => isf.DirectoryExists("foo"));
     }
 }
Пример #5
0
 // Dispose of this stream.
 protected override void Dispose(bool disposing)
 {
     realStream.Close();
     if (storeToClose != null)
     {
         storeToClose.Close();
     }
     base.Dispose(disposing);
 }
Пример #6
0
 public void OpenFile_Closed_ThrowsInvalidOperationException()
 {
     using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
     {
         isf.Close();
         Assert.Throws <InvalidOperationException>(() => isf.OpenFile("foo", FileMode.Append));
         Assert.Throws <InvalidOperationException>(() => isf.OpenFile("foo", FileMode.Append, FileAccess.ReadWrite));
         Assert.Throws <InvalidOperationException>(() => isf.OpenFile("foo", FileMode.Append, FileAccess.ReadWrite, FileShare.ReadWrite));
     }
 }
Пример #7
0
        // Remove all stores of a particular type.
        public static void Remove(IsolatedStorageScope scope)
        {
            IsolatedStorageFile file = GetStore(scope);

            try
            {
                file.Remove();
            }
            finally
            {
                file.Close();
            }
        }
Пример #8
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (m_fs != null)
         {
             m_fs.Close();
         }
         if (m_OwnedStore && m_isf != null)
         {
             m_isf.Close();
         }
     }
     base.Dispose(disposing);
 }