FileDialogCollectionNavigator.cs 766 B

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