public void AddWordlist(Wordlist wordlist) { try { vm.Add(wordlist); } catch (Exception e) { SB.Logger.LogError(Components.WordlistManager, e.Message); } }
private void importWordlistButton_MouseDown(object sender, MouseButtonEventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Wordlist file | *.txt"; ofd.FilterIndex = 1; if (ofd.ShowDialog() == DialogResult.OK) { pathTextBox.Text = ofd.FileName; if (addToWordlistsCheckBox.IsChecked.GetValueOrDefault()) { try { var wordlist = WordlistManagerViewModel.FileToWordlist(ofd.FileName); wordlist.RemoveDup = removeDupCheckBox.IsChecked.GetValueOrDefault(); vm.Add(wordlist); } catch (Exception ex) { SB.Logger.Log(ex.Message, RuriLib.LogLevel.Error, true); } } else { try { // Add the wordlist to the runner var wordlist = WordlistManagerViewModel.FileToWordlist(ofd.FileName); wordlist.RemoveDup = removeDupCheckBox.IsChecked.GetValueOrDefault(); ((Runner)Caller).SetWordlist(wordlist); ((MainDialog)Parent).Close(); } catch { } } } }