Ejemplo n.º 1
0
        public void Unmount()
        {
            Debug.WriteLine("Unmount");

            Status = DriveStatus.Unmounting;
            try
            {
               // Dokan.Unmount(Letter);
                Dokan.RemoveMountPoint(String.Format("{0}:\\", Letter));
                if (_filesystem != null)
                {

                    _filesystem.Dispose();


                   
                }
            }
            catch
            {
                //Status = DriveStatus.Unmounted;
                //  OnStatusChanged(EventArgs.Empty);
            }
            finally
            {
                _filesystem = null;  
            }

        }
Ejemplo n.º 2
0
        public void Dispose()
        {
            Debug.WriteLine("Dispose");

            _threadCancel?.Cancel();
            _pauseEvent?.Set();

            try
            {
                Dokan.RemoveMountPoint($"{Letter}:\\");
                if (_filesystem != null)
                {
                    _filesystem.Dispose();
                    _filesystem = null;
                }
            }
            catch
            {
                if (Status != DriveStatus.Unmounted)
                {
                    Status = DriveStatus.Unmounted;
                }
            }
            finally
            {
                _filesystem = null;
            }

            _mountCancel?.Dispose();
            _threadCancel?.Dispose();
            _pauseEvent?.Dispose();
        }
Ejemplo n.º 3
0
        public void Unmount()
        {
            if (this.reconnectThread != Thread.CurrentThread)
            {
                this.stopReconnect();
            }

            if (_threadCancel != null)
            {
                _threadCancel.Cancel();
            }
            if (_pauseEvent != null)
            {
                _pauseEvent.Set();
            }

            Debug.WriteLine("Unmount");
            Status = DriveStatus.Unmounting;
            try
            {
                Dokan.RemoveMountPoint($"{Letter}:\\");
                _filesystem?.Dispose();
            }
            catch
            {
                //Status = DriveStatus.Unmounted;
                //  OnStatusChanged(EventArgs.Empty);
            }
            finally
            {
                _filesystem = null;
                Status      = DriveStatus.Unmounted;
                OnStatusChanged(EventArgs.Empty);
            }
        }