LinuxMount.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System;
  2. using MediaBrowser.Model.Diagnostics;
  3. using MediaBrowser.Model.IO;
  4. using MediaBrowser.Model.Logging;
  5. using MediaBrowser.Model.System;
  6. namespace IsoMounter
  7. {
  8. internal class LinuxMount : IIsoMount
  9. {
  10. #region Private Fields
  11. private readonly LinuxIsoManager linuxIsoManager;
  12. #endregion
  13. #region Constructor(s)
  14. internal LinuxMount(LinuxIsoManager isoManager, string isoPath, string mountFolder)
  15. {
  16. linuxIsoManager = isoManager;
  17. IsoPath = isoPath;
  18. MountedPath = mountFolder;
  19. }
  20. #endregion
  21. #region Interface Implementation for IDisposable
  22. // Flag: Has Dispose already been called?
  23. private bool disposed = false;
  24. public void Dispose()
  25. {
  26. // Dispose of unmanaged resources.
  27. Dispose(true);
  28. // Suppress finalization.
  29. GC.SuppressFinalize(this);
  30. }
  31. protected virtual void Dispose(bool disposing)
  32. {
  33. if (disposed) {
  34. return;
  35. }
  36. if (disposing) {
  37. //
  38. // Free managed objects here.
  39. //
  40. linuxIsoManager.OnUnmount(this);
  41. }
  42. //
  43. // Free any unmanaged objects here.
  44. //
  45. disposed = true;
  46. }
  47. #endregion
  48. #region Interface Implementation for IIsoMount
  49. public string IsoPath { get; private set; }
  50. public string MountedPath { get; private set; }
  51. #endregion
  52. }
  53. }