private void BtnImportClick(object sender, RoutedEventArgs e) { var ofd = new OpenFileDialog { Filter = "Text files (*.txt)|*.txt" }; var result = ofd.ShowDialog(); if (result == true) { if (!File.Exists(ofd.FileName)) { return; } var accounts = Utils.GetLogins(ofd.FileName); if (!accounts.Any()) { return; } var window = new ImportWindow(accounts); window.ShowDialog(); } }
private void BtnImportClick(object sender, RoutedEventArgs e) { OpenFileDialog ofd = new OpenFileDialog { Filter = "Text File (*.txt)|*.txt" }; if (ofd.ShowDialog() == true) { if (!File.Exists(ofd.FileName)) { return; } List<string[]> accounts = Utils.GetLogins(ofd.FileName); if (!accounts.Any()) { return; } ImportWindow window = new ImportWindow(accounts); window.ShowDialog(); } }