/// <summary> /// Create the archive editor with the given CompressionLevel for the current CMF Archive instance. /// </summary> /// <param name="compressionLevel">The compression level that the editor will use to compress data</param> /// <param name="temporaryFolder">The directory for temporary files</param> /// <returns></returns> public IEditor OpenEditor(string temporaryFolder, CompressionLevel compressionLevel) { if (this._disposed) { throw new System.ObjectDisposedException("Archive"); } if (this.myReader != null) { throw new InvalidOperationException("You can only have one reader per archive. Dispose the old one before getting a new one."); } if (string.IsNullOrWhiteSpace(temporaryFolder)) { temporaryFolder = Path.GetTempPath(); } this.myEditor = new CMFEditor(this, temporaryFolder, compressionLevel); this.myEditor.Disposed += this.myEditor_Disposed; return(this.myEditor); }
private void myEditor_Disposed(object sender, EventArgs e) { this.myEditor = null; }