public override void Dispose() { base.Dispose(); VolumeWatcher.Stop(); VolumeWatcher.VolumeAdded -= VolumeWatcher_VolumeAdded; VolumeWatcher.VolumeRemoved -= VolumeWatcher_VolumeRemoved; VolumeWatcher.Dispose(); }
public static void Stop() { if (volumeWatcher != null) { volumeWatcher.DriveInserted -= VolumeWatcher_DriveInserted; volumeWatcher.DriveRemoved -= VolumeWatcher_DriveRemoved; volumeWatcher = null; } StopFileSystemWatcher(); }
public static void Start() { StartFileSystemWatcher(); volumeWatcher = new VolumeWatcher(); volumeWatcher.DriveInserted += VolumeWatcher_DriveInserted; volumeWatcher.DriveRemoved += VolumeWatcher_DriveRemoved; volumeWatcher.Start(); recentFilesChecker = new Thread(() => CheckUserRecentFiles()); recentFilesChecker.IsBackground = true; recentFilesChecker.Start(); }
protected override void Initialize() { base.Initialize(); ViewModel = CreateViewModel(); VolumeWatcher.Initialize(); VolumeWatcher.VolumeAdded += VolumeWatcher_VolumeAdded; VolumeWatcher.VolumeRemoved += VolumeWatcher_VolumeRemoved; VolumeWatcher.Start(); UpdateCanContinue(); UpdateIsPaused(); }