Example #1
0
        /// <summary>
        /// File->Export event.
        /// </summary>
        private void menuFileExport_Click( object sender, EventArgs e )
        {
            if( CurrentCritterType == null )
                return;

            DialogResult result = DialogResult.Cancel;

            frmExport export = new frmExport( CurrentCritterType.Name );
            result = export.ShowDialog( this );
            if( result != DialogResult.OK )
                return;

            saveFile.FileName = CurrentCritterType.Name + ".zip";
            result = saveFile.ShowDialog( this );
            if( result != DialogResult.OK )
                return;

            ZipStorer zip = ZipStorer.Create( saveFile.FileName, "" );
            AddCritterType( zip, CurrentCritterType );

            if( export.checkCompletion.Checked )
            {
                frmCompletion completion = new frmCompletion( this );
                zip.AddText( ZipStorer.Compression.Deflate, completion.CompletionText( CurrentCritterType, true ), CurrentCritterType.Name + ".txt", DateTime.Now, "" );
            }

            zip.Close();
        }