protected virtual void Dispose( bool isDisposing ) { if ( isDisposing ) { xUnzip.Close (); xUnzip = null; } }
public ZipFileSystem( Stream stream ) { xUnzip = new XUnzip (); xUnzip.Open ( stream ); indexInfo = new Dictionary<string, int> (); List<string> files = new List<string> (); List<string> dirs = new List<string> (); int index = 0; foreach ( XUnzipFileInfo info in xUnzip.FileInfo ) { indexInfo.Add ( info.FileName, index++ ); files.Add ( info.FileName ); string [] temp = info.FileName.Split ( '/' ); if ( temp.Length == 1 ) temp = info.FileName.Split ( '\\' ); temp [ temp.Length - 1 ] = ""; string path = string.Join ( "/", temp ); if ( dirs.Contains ( path ) ) continue; dirs.Add ( path ); } filenameCache = files.ToArray (); dirnameCache = dirs.ToArray (); }