Skip to main content

FilePickerRequest class

Namespace: Arlecchino.State · Assembly: Arlecchino

Everything the file picker needs for one round of picking. Unlike the modals, the picker is a view of its own, so the request also carries where to go once it is done.

public sealed class FilePickerRequest : IEquatable<FilePickerRequest>

Implements IEquatable<T><FilePickerRequest>

Constructors

MemberSummary
FilePickerRequest(string, bool, string, ViewRoute, Action<string>)Everything the file picker needs for one round of picking. Unlike the modals, the picker is a view of its own, so the request also carries where to go once it is done.

Properties

MemberSummary
FileFilterDecides which files are worth showing, by full path. Folders are always listed, since they have to be walked through to reach anything.
InitialPathWhere browsing starts.
OnPickedCalled with the full path that was chosen.
PickFolderWhether a folder is being chosen rather than a file.
PlacesShortcuts offered in the sidebar.
ReturnViewThe view to return to, whether anything was picked.
TitleHeading shown above the listing.

Methods

MemberSummary
Deconstruct(out string, out bool, out string, out ViewRoute, out Action<string>)

Constructors in detail

FilePickerRequest(string, bool, string, ViewRoute, Action<string>)

public FilePickerRequest(
string Title,
bool PickFolder,
string InitialPath,
ViewRoute ReturnView,
Action<string> OnPicked);

Everything the file picker needs for one round of picking. Unlike the modals, the picker is a view of its own, so the request also carries where to go once it is done.

Parameters

NameTypeDescription
TitlestringHeading shown above the listing.
PickFolderboolWhether a folder is being chosen rather than a file.
InitialPathstringWhere browsing starts.
ReturnViewViewRouteThe view to return to, whether anything was picked.
OnPickedAction<T><string>Called with the full path that was chosen.

Properties in detail

FileFilter

public Func<string, bool>? FileFilter { get; init; }

Decides which files are worth showing, by full path. Folders are always listed, since they have to be walked through to reach anything.

Type Func<T, TResult><string, bool>

InitialPath

public string InitialPath { get; init; }

Where browsing starts.

Type string

OnPicked

public Action<string> OnPicked { get; init; }

Called with the full path that was chosen.

Type Action<T><string>

PickFolder

public bool PickFolder { get; init; }

Whether a folder is being chosen rather than a file.

Type bool

Places

public IReadOnlyList<FilePickerPlace> Places { get; init; }

Shortcuts offered in the sidebar.

Type IReadOnlyList<T><FilePickerPlace>

ReturnView

public ViewRoute ReturnView { get; init; }

The view to return to, whether anything was picked.

Type ViewRoute

Title

public string Title { get; init; }

Heading shown above the listing.

Type string

Methods in detail

Deconstruct(out string, out bool, out string, out ViewRoute, out Action<string>)

public void Deconstruct(
out string Title,
out bool PickFolder,
out string InitialPath,
out ViewRoute ReturnView,
out Action<string> OnPicked);

Parameters

NameTypeDescription
Titlestring
PickFolderbool
InitialPathstring
ReturnViewViewRoute
OnPickedAction<T><string>