Пример #1
0
        public async Task UnmountAsync()
        {
            if (MountLetter == null)
            {
                return;
            }

            if (App == null)
            {
                throw new NullReferenceException();
            }

            unmounting = true;
            NotifyMount();
            try
            {
                await Task.Factory.StartNew(() =>
                {
                    using (unmountingEvent = new ManualResetEventSlim(false))
                    {
                        VirtualDriveWrapper.Unmount((char)MountLetter);
                        unmountingEvent.Wait();
                    }
                });

                MountLetter = null;
                Provider.Stop();
                model.NotifyUnmount(cloudInfo.Id);
            }
            finally
            {
                unmounting = false;
                NotifyMount();
            }
        }
Пример #2
0
        internal async Task Unmount()
        {
            if (mounted == 0)
            {
                return;
            }

            VirtualDriveWrapper.Unmount((char)mountedLetter);
            await mountTask;
        }
Пример #3
0
        private void Application_Exit(object sender, ExitEventArgs e)
        {
            if (notifyIcon != null)
            {
                notifyIcon.Dispose();
            }

            if (mounted == 0)
            {
                return;
            }

            VirtualDriveWrapper.Unmount((char)mountedLetter);
            mountTask.Wait();
        }