2018-12-10 23:39:20 +00:00
|
|
|
using System;
|
|
|
|
using MediaBrowser.Model.IO;
|
|
|
|
|
|
|
|
namespace IsoMounter
|
|
|
|
{
|
|
|
|
internal class LinuxMount : IIsoMount
|
|
|
|
{
|
|
|
|
|
|
|
|
#region Private Fields
|
|
|
|
|
|
|
|
private readonly LinuxIsoManager linuxIsoManager;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Constructor(s)
|
|
|
|
|
|
|
|
internal LinuxMount(LinuxIsoManager isoManager, string isoPath, string mountFolder)
|
|
|
|
{
|
|
|
|
|
|
|
|
linuxIsoManager = isoManager;
|
|
|
|
|
|
|
|
IsoPath = isoPath;
|
|
|
|
MountedPath = mountFolder;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Interface Implementation for IDisposable
|
|
|
|
|
|
|
|
// Flag: Has Dispose already been called?
|
|
|
|
private bool disposed = false;
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
|
|
|
|
// Dispose of unmanaged resources.
|
|
|
|
Dispose(true);
|
|
|
|
|
|
|
|
// Suppress finalization.
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (disposed) {
|
|
|
|
return;
|
|
|
|
}
|
2019-01-07 23:27:46 +00:00
|
|
|
|
2018-12-10 23:39:20 +00:00
|
|
|
if (disposing) {
|
|
|
|
|
|
|
|
//
|
|
|
|
// Free managed objects here.
|
|
|
|
//
|
|
|
|
|
|
|
|
linuxIsoManager.OnUnmount(this);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Free any unmanaged objects here.
|
|
|
|
//
|
|
|
|
|
|
|
|
disposed = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Interface Implementation for IIsoMount
|
|
|
|
|
|
|
|
public string IsoPath { get; private set; }
|
|
|
|
public string MountedPath { get; private set; }
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|