private void Button_Click_1(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog openFileDlg = new Microsoft.Win32.OpenFileDialog(); // Launch OpenFileDialog by calling ShowDialog method Nullable <bool> result = openFileDlg.ShowDialog(); // Get the selected file name and display in a TextBox. // Load content of file in a TextBlock if (result == true) { pathdest.Text = openFileDlg.FileName; } }
private void addButton_Click(object sender, RoutedEventArgs e) { var screen = new Microsoft.Win32.OpenFileDialog(); screen.Multiselect = true; screen.Filter = "Sound files | *.mp3; *.wma; *.MP3"; if (screen.ShowDialog() == true) { foreach (var file in screen.FileNames) { var info = new FileInfo(file); if (!_fullPaths.Contains(info)) { _fullPaths.Add(info); } } playlistListBox.ItemsSource = _fullPaths; } }
void btnImportManualLinks_Click(object sender, RoutedEventArgs e) { if (ShokoServer.IsMyAnime2WorkerBusy()) { MessageBox.Show(Shoko.Commons.Properties.Resources.Server_Import, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } txtMA2Progress.Visibility = System.Windows.Visibility.Visible; txtMA2Success.Visibility = System.Windows.Visibility.Visible; Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog { Filter = "Sqlite Files (*.DB3)|*.db3" }; ofd.ShowDialog(); if (!string.IsNullOrEmpty(ofd.FileName)) { ShokoServer.RunMyAnime2WorkerAsync(ofd.FileName); } }