Table of Contents

Class FileSystemFolderBrowser

Namespace
ItTiger.TigerCli.Tui.Controls
Assembly
ItTiger.TigerCli.dll
Default IFolderBrowser backed by System.IO. Exception-safe: unauthorized, missing, or transiently failing locations surface as empty listings rather than thrown exceptions. Platform behavior follows the host OS by default and can be overridden for testing.
public sealed class FileSystemFolderBrowser : IFolderBrowser
Inheritance
FileSystemFolderBrowser
Implements
Inherited Members

Constructors

FileSystemFolderBrowser(bool?)

public FileSystemFolderBrowser(bool? windowsStyle = null)

Parameters

windowsStyle bool?
When true, the top level is a drive list and drive roots have no parent above the list. When false, the top level is "/". Defaults to the host OS.

Properties

RootLocation

The conceptual top location. On Windows this is null (a synthetic drive list); on Unix this is "/". Used as the fallback target for unresolvable initial paths.
public string? RootLocation { get; }

Property Value

string

Methods

GetEntries(string?)

Lists the selectable folder rows at location. A null location means the Windows drive list. Returns an empty list when the location is unreadable.
public IReadOnlyList<FolderEntry> GetEntries(string? location)

Parameters

location string

Returns

IReadOnlyList<FolderEntry>

ResolveInitial(string?)

Resolves a caller-supplied initial path into a starting location and the path that should be highlighted within that location. When the path cannot be found or read, falls back to the closest readable ancestor, and ultimately to RootLocation with no specific highlight.
public (string? location, string? highlightPath) ResolveInitial(string? initialPath)

Parameters

initialPath string

Returns

(string location, string highlightPath)

TryGetParent(string?, out string?)

Computes the parent location to navigate to from location. Returns false when already at the top (the Windows drive list, or Unix "/"), in which case no upward navigation occurs. When it returns true, parent is the parent location (which may be null to return to the Windows drive list).
public bool TryGetParent(string? location, out string? parent)

Parameters

location string
parent string

Returns

bool