private async void OnConnect(object obj) { if (IsWorking) { return; } Message = ""; if (GoldDriveList.Count == 0 || string.IsNullOrEmpty(SelectedDrive.Host)) { IsDriveNew = true; SelectedDrive = FreeDriveList.First(); CurrentPage = Page.Host; return; } if (ConnectButtonText == "Connect") { ConnectAsync(SelectedDrive); } else { WorkStart("Disconnecting..."); ReturnBox r = await Task.Run(() => _mountService.Unmount(SelectedDrive)); WorkDone(r); } }
public async void LoadDrivesAsync() { Loaded = false; WorkStart("Exploring local drives..."); await Task.Run(() => { Settings settings = _mountService.LoadSettings(); if (_selectedDrive == null && settings.SelectedDrive != null) { SelectedDrive = settings.SelectedDrive; } _mountService.UpdateDrives(settings); }); UpdateObservableDrives(); if (_mountService.GoldDrives.Count == 0) { CurrentPage = Page.Host; IsDriveNew = true; OnFocusRequested(nameof(SelectedDrive.Host)); SelectedDrive = FreeDriveList.First(); WorkDone(); } else { CheckDriveStatusAsync(); } Loaded = true; }
private void OnSettingsNew(object obj) { OriginalDrive = new Drive(SelectedDrive); SelectedDrive = FreeDriveList.First(); IsDriveNew = true; }