LinuxMount.cs 1.5 KB

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