protected override void EnterStep() { StepViewModel.CanGoBack = false; if (ViewModel.IsEject) { //ViewModel = CreateViewModel(); ViewModel.Title = Resources.Eject_Ejecting_Text; VolumeWatcher.Stop(); var card = CardViewModel.SelectedItem?.Info; if (card != null) { EjectService.Eject(card.DriveLetter); var card2 = CardDetector.GetCard(card.DriveLetter); ViewModel.IsCompleted = card2 == null; } } }
private void AddCard(string driveLetter) { var card = CardDetector.GetCard(driveLetter); if (card == null) { Logger.LogWarning("Non-removable {0}", driveLetter); return; } var vm = ViewModel.Items.SingleOrDefault(c => c.Info.DriveLetter.Equals(driveLetter)); if (vm != null) { Logger.LogError("Already added {0}", driveLetter); return; } Logger.LogObject(LogLevel.Information, "Added {0}", card); ViewModel.Items.Add(CreateCardItem(card)); }