private void Drives_Change(object sender, SelectionChangedEventArgs e) { try { SwitchDrive(); } catch (Exception ex) { AppendErrorDelegate?.Invoke(ex.Message, ex); } }
private void OpenButton_Click(object sender, RoutedEventArgs e) { try { if (CreateNewFile && File.Exists(FileFullPathInput.Text) && MessageBoxResult.No == MessageBox.Show(this, OverwriteMessage, OverwriteDialogTitle, MessageBoxButton.YesNo)) { return; } SelectedPath = FileFullPathInput.Text; Close(); } catch (Exception ex) { AppendErrorDelegate?.Invoke(ex.Message, ex); } }
private void FileList_Select(object sender, SelectedCellsChangedEventArgs e) { try { if (!((sender as DataGrid)?.SelectedItem is RowEntity row)) { return; } if (row.TryGetMember(@"FileName", out var selectedFile)) { FileFullPathInput.Text = selectedFile as string ?? @""; } } catch (Exception ex) { AppendErrorDelegate?.Invoke(ex.Message, ex); } }
private void Item_Select(object sender, RoutedEventArgs e) { try { if (!((sender as TreeView)?.SelectedItem is FileSystemNode item)) { return; } GridOperator.DisplayDirectory(item); if (CreateNewFile) { FileFullPathInput.Text = item.FullPath; } } catch (Exception ex) { AppendErrorDelegate?.Invoke(ex.Message, ex); } }