Esempio n. 1
0
 protected override void Dispose(bool disposing)
 {
     if (this.fileHandle != IntPtr.Zero)
     {
         WindowsVirtualFileStream.CloseHandle(this.fileHandle);
         this.fileHandle = IntPtr.Zero;
     }
     base.Dispose(disposing);
 }
Esempio n. 2
0
 public override void Close()
 {
     if (this.fileHandle != IntPtr.Zero)
     {
         WindowsVirtualFileStream.CloseHandle(this.fileHandle);
         this.fileHandle = IntPtr.Zero;
     }
     base.Close();
 }
Esempio n. 3
0
        public override long Seek(long offset, SeekOrigin origin)
        {
            if (this.fileHandle == IntPtr.Zero)
            {
                throw new ObjectDisposedException(null);
            }
            int num;

            this.an = (int)WindowsVirtualFileStream.A(this.fileHandle, offset, origin, out num);
            if (this.an == -1)
            {
                throw new IOException("Seeking file length failed.");
            }
            return((long)this.an);
        }