Beispiel #1
0
 public void Dispose()
 {
     if (this.archiveHandle != IntPtr.Zero)
     {
         Unrar.RARCloseArchive(this.archiveHandle);
         this.archiveHandle = IntPtr.Zero;
     }
 }
Beispiel #2
0
        /// <summary>
        /// Close the currently open archive
        /// </summary>
        /// <returns></returns>
        public void Close()
        {
            // Exit without exception if no archive is open
            if (this.archiveHandle == IntPtr.Zero)
            {
                return;
            }

            // Close archive
            int result = Unrar.RARCloseArchive(this.archiveHandle);

            // Check result
            if (result != 0)
            {
                ProcessFileError(result);
            }
            else
            {
                this.archiveHandle = IntPtr.Zero;
            }
        }