FileDialogCollectionNavigator.cs 742 B

123456789101112131415161718192021
  1. namespace Terminal.Gui;
  2. internal class FileDialogCollectionNavigator (FileDialog fileDialog, TableView tableView) : CollectionNavigatorBase
  3. {
  4. protected override object ElementAt (int idx)
  5. {
  6. object val = FileDialogTableSource.GetRawColumnValue (
  7. tableView.SelectedColumn,
  8. fileDialog.State?.Children [idx]
  9. );
  10. if (val is null)
  11. {
  12. return string.Empty;
  13. }
  14. return val.ToString ().Trim ('.');
  15. }
  16. protected override int GetCollectionLength () { return fileDialog.State?.Children.Length ?? 0; }
  17. }