private void OnOpen() { DriveSelectResult result = Dialogs.ShowDriveSelect(WindowOwner); if (result != null) { Scanning.CloseAsync(() => Scanning.ScanAsync(result)); } }
private void OnOK() { // Apply the settings for future use Settings.DriveSelectMode = mode; Settings.SelectedDrives = SelectedDrives.Select(d => d.Name).ToArray(); Settings.SelectedFolderPath = folderPath; Result = new DriveSelectResult(Scanning, Settings.DriveSelectMode, Settings.SelectedDrives, Settings.SelectedFolderPath); }
/// <summary>Begins a synchronous scan of the specified root paths.</summary> public void Scan(DriveSelectResult result) { if (result == null) { throw new ArgumentNullException(nameof(result)); } ThrowIfScanning(); lock (threadLock) { RootPaths = result.GetResultPaths(); driveSelectResult = result; ScanPrepare(false); ScanThread(false, cancel.Token); } }
/// <summary>Begins a asynchronous scan of the specified root paths.</summary> public void ScanAsync(DriveSelectResult result) { if (result == null) { throw new ArgumentNullException(nameof(result)); } ThrowIfScanning(); lock (threadLock) { RootPaths = result.GetResultPaths(); driveSelectResult = result; ScanPrepare(false); scanThread = new Thread(() => ScanThread(false, cancel.Token)) { Priority = settings.ScanPriority, Name = "File Scan", }; scanThread.Start(); } }