Пример #1
0
        public void Run()
        {
            reader = new ZipReader();
            reader.ShouldProcessZipEntry = ShouldProcessZipEntry_Classic;
            reader.ProcessZipEntry = ProcessZipEntry_Classic;
            string texDir = Path.Combine( Program.AppDirectory, "texpacks" );
            string path = Path.Combine( texDir, "default.zip" );
            ExtractExisting( path );

            using( Stream dst = new FileStream( path, FileMode.Create, FileAccess.Write ) ) {
                writer = new ZipWriter( dst );
                writer.entries = new ZipEntry[100];
                for( int i = 0; i < entries.Count; i++ )
                    writer.WriteZipEntry( entries[i], datas[i] );

                ExtractClassic();
                ExtractModern();
                if( pngGuiPatch != null ) {
                    using( Bitmap guiBitmap = new Bitmap( new MemoryStream( pngGuiPatch ) ) )
                        writer.WriteNewImage( guiBitmap, "gui.png" );
                }
                writer.WriteCentralDirectoryRecords();
            }
        }