private void btnExport_Clicked(object sender, RoutedEventArgs e) { if (SettingsBox.SelectedIndex != -1) { string settingName = SettingsBox.SelectedItem.ToString(); string fingerprint = ""; if (FingerprintBox.IsEnabled && FingerprintBox.SelectedIndex != -1) { fingerprint = FingerprintBox.SelectedItem.ToString(); } else if (FingerprintBox.IsEnabled && FingerprintBox.SelectedIndex == -1) { MessageBox.Show("Please select a fingerprint!", "Error: No fingerprint selected", MessageBoxButton.OK, MessageBoxImage.Error); return; } if (PuttyRegistry.ExportSettings(settingName, ChkBxFingerprint.IsEnabled, fingerprint)) { MessageBox.Show("Successfully exported Settings to " + settingName + ".xml", "Success!", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("Unknown error on exporting!", "Unkown Error", MessageBoxButton.OK, MessageBoxImage.Error); } return; } MessageBox.Show("Please select a setting!", "Error: No setting selected", MessageBoxButton.OK, MessageBoxImage.Error); }
private void MnExport_Clicked(object sender, RoutedEventArgs e) { ExportWindow expWindow = new ExportWindow(); expWindow.SettingsBox.ItemsSource = PuttyRegistry.GetSettings(); expWindow.FingerprintBox.ItemsSource = PuttyRegistry.GetFingerprints(); expWindow.Show(); }
public void LoadSessions() { var puttyRegistry = new PuttyRegistry(); var result = puttyRegistry.GetSessions(); // session names arent case sensitive and are unique Assert.IsNotNull(result); }