private void destBrowseButton_Click(object sender, RoutedEventArgs e) { var destBrowser = ElementHelper.DirectoryBrowser(sourceTextBox.Text); destBrowser.ShowDialog(); destTextBox.Text = destBrowser.SelectedPath; }
private void MoveSelected() { var destBrowser = ElementHelper.DirectoryBrowser(); destBrowser.ShowDialog(); if (!String.IsNullOrEmpty(destBrowser.SelectedPath)) { var dest = new DirectoryInfo(destBrowser.SelectedPath); var directories = GetSelectedDirectories(); var files = GetSelectedFiles(); //Move selected directories foreach (var dir in directories.ToList()) { try { dir.MoveTo($"{dest.FullName}\\{dir.Name}"); } catch (Exception ex) { LogHelper.LogError(ex); } } //Move selected files foreach (var file in files.ToList()) { try { file.MoveTo($"{dest.FullName}\\{file.Name}"); } catch (Exception ex) { LogHelper.LogError(ex); } } contentsLabel.Content = $"Count: {newFilesListBox.Items.Count}"; selectedFilesListBox.Items.Clear(); } }