private void button1_Click(object sender, EventArgs e) { var process = listBox1.SelectedItem as ManagedApplicationInfo; if (process == null) { return; } _inspectionService.Inspect(process); }
private void Inspect() { if (ManagedApplicationsInfo.ManagedApplicationInfos.CurrentItem == null) { return; } try { string error = _inspectionService.Inspect((ManagedApplicationInfo)ManagedApplicationsInfo.ManagedApplicationInfos.CurrentItem); if (string.IsNullOrEmpty(error)) { Application.Current.Shutdown(); } else { MessageBox.Show(error, "Application inspection failed.", MessageBoxButton.OK, MessageBoxImage.Error); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Application inspection failed.", MessageBoxButton.OK, MessageBoxImage.Error); } }
public void Inspect_ShouldInspectDefibrillator() { inspectionService.Inspect(SERIAL_NUMBER); defibrillator.Verify(d => d.Inspect()); }