using System;
using MediaBrowser.Model.IO;
namespace IsoMounter
{
///
/// Class LinuxMount.
///
internal class LinuxMount : IIsoMount
{
private readonly LinuxIsoManager _linuxIsoManager;
private bool _disposed = false;
///
/// Initializes a new instance of the class.
///
/// The ISO manager that mounted this ISO file.
/// The path to the ISO file.
/// The folder the ISO is mounted in.
internal LinuxMount(LinuxIsoManager isoManager, string isoPath, string mountFolder)
{
_linuxIsoManager = isoManager;
IsoPath = isoPath;
MountedPath = mountFolder;
}
///
public string IsoPath { get; }
///
public string MountedPath { get; }
///
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
///
/// Releases the unmanaged resources and disposes of the managed resources used.
///
/// Whether or not the managed resources should be disposed.
protected virtual void Dispose(bool disposing)
{
if (_disposed)
{
return;
}
_linuxIsoManager.OnUnmount(this);
_disposed = true;
}
}
}