Ejemplo n.º 1
0
 /// <summary>
 /// Disposes of underlying resources.
 /// </summary>
 /// <param name="disposing">Set to <c>true</c> if called within Dispose(),
 /// else <c>false</c>.</param>
 protected override void Dispose(bool disposing)
 {
     try
     {
         if (disposing)
         {
             if (_file != null)
             {
                 _file.Dispose();
             }
             _file = null;
         }
     }
     finally
     {
         base.Dispose(disposing);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the Disc class.
        /// </summary>
        /// <param name="path">The path to the disc image</param>
        /// <param name="access">The access requested to the disk</param>
        public Disc(string path, FileAccess access)
        {
            FileShare share = (access == FileAccess.Read) ? FileShare.Read : FileShare.None;

            _file = new DiscImageFile(new FileStream(path, FileMode.Open, access, share), Ownership.Dispose, OpticalFormat.None);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the Disc class.
 /// </summary>
 /// <param name="path">The path to the disc image</param>
 public Disc(string path)
 {
     _file = new DiscImageFile(new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None), Ownership.Dispose, OpticalFormat.None);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the Disc class.
 /// </summary>
 /// <param name="stream">The stream to read</param>
 /// <param name="ownsStream">Indicates if the new instance should control the lifetime of the stream.</param>
 /// <param name="format">The disk image format</param>
 public Disc(Stream stream, Ownership ownsStream, OpticalFormat format)
 {
     _file = new DiscImageFile(stream, ownsStream, format);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the Disc class.
 /// </summary>
 /// <param name="path">The path to the disc image</param>
 /// <param name="access">The access requested to the disk</param>
 public Disc(string path, FileAccess access)
 {
     FileShare share = (access == FileAccess.Read) ? FileShare.Read : FileShare.None;
     _file = new DiscImageFile(new FileStream(path, FileMode.Open, access, share), Ownership.Dispose, OpticalFormat.None);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the Disc class.
 /// </summary>
 /// <param name="path">The path to the disc image</param>
 public Disc(string path)
 {
     _file = new DiscImageFile(new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None), Ownership.Dispose, OpticalFormat.None);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the Disc class.
 /// </summary>
 /// <param name="stream">The stream to read</param>
 /// <param name="ownsStream">Indicates if the new instance should control the lifetime of the stream.</param>
 /// <param name="format">The disk image format</param>
 public Disc(Stream stream, Ownership ownsStream, OpticalFormat format)
 {
     _file = new DiscImageFile(stream, ownsStream, format);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Disposes of underlying resources.
        /// </summary>
        /// <param name="disposing">Set to <c>true</c> if called within Dispose(),
        /// else <c>false</c>.</param>
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing)
                {
                    if (_file != null)
                    {
                        _file.Dispose();
                    }

                    _file = null;
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }