/// <summary> /// Initializes a new instance of the <see cref="JolietDiscMasterStorage"/> class. /// </summary> /// <param name="owner">The owner.</param> /// <param name="folder">The folder.</param> internal JolietDiscMasterStorage( DiscMaster owner, string folder ) { if ( owner == null ) { throw new ArgumentNullException( "owner" ); } // End if (owner == null) _owner = owner; _folderName = folder; _subfolders = new Dictionary<string, JolietDiscMasterStorage>(); _files = new Dictionary<string, string>(); _storage = new JolietStorage( this, _folderName ); }
/// <summary> /// Dispose(bool disposing) executes in two distinct scenarios. /// If disposing equals true, the method has been called directly /// or indirectly by a user's code. Managed and unmanaged resources /// can be disposed. /// </summary> /// <param name="disposing"> /// If disposing equals false, the method has been called by the /// runtime from inside the finalizer and you should not reference /// other objects. Only unmanaged resources can be disposed. /// </param> protected override void Dispose( bool disposing ) { // Check to see if Dispose has already been called. if ( disposing && !IsDisposed ) { // Dispose managed resources. if ( _storage != null ) { foreach ( JolietDiscMasterStorage subStorage in _subfolders.Values ) { subStorage.Dispose(); } // End foreach _storage.Dispose(); _storage = null; } } base.Dispose( disposing ); }