Ejemplo n.º 1
0
        /// <summary>
        /// Disposes of this instance, freeing underlying resources.
        /// </summary>
        /// <param name="disposing"><c>true</c> if called from Dispose</param>
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing)
                {
                    if (_content != null)
                    {
                        _content.Dispose();
                        _content = null;
                    }

                    if (_file != null)
                    {
                        _file.Dispose();
                        _file = null;
                    }
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the Disk class.
 /// </summary>
 /// <param name="stream">The stream containing the disk</param>
 /// <param name="ownsStream">Whether the new instance takes ownership of stream</param>
 public Disk(Stream stream, Ownership ownsStream)
 {
     _file = new DiskImageFile(stream, ownsStream);
 }