public sealed record FileDialogFilter : IEquatable<FileDialogFilter> A named file type a file dialog offers, such as "Images" for png and jpg.
Parameters
NameThe name the dialog shows, in the user's language.
ExtensionsExtensions without the leading dot, such as
pngortar.gz, or*for every file. At least one.
Exceptions
ArgumentExceptionThe name is empty, or an extension is empty or contains a path separator, a wildcard other than a lone
*, a leading dot or a character that cannot appear in a filename pattern.
Remarks
A filter is a hint to the dialog: it limits which files the dialog shows, but the user can still choose or type a name that matches no filter on some platforms, and Runic does not reject such a selection. Validate the content you read. Extensions match case-insensitively on every platform. macOS shows no filter pop-up unless OpenFileOptions.ShowFilterChoice or SaveFileOptions.ShowFilterChoice asks for one: without it, its panel offers the files of every filter at once.
Constructors
FileDialogFilter
public FileDialogFilter(string Name, ImmutableArray<string> Extensions) A named file type a file dialog offers, such as "Images" for png and jpg.
Parameters
NameThe name the dialog shows, in the user's language.
ExtensionsExtensions without the leading dot, such as
pngortar.gz, or*for every file. At least one.
Exceptions
ArgumentExceptionThe name is empty, or an extension is empty or contains a path separator, a wildcard other than a lone
*, a leading dot or a character that cannot appear in a filename pattern.
Remarks
A filter is a hint to the dialog: it limits which files the dialog shows, but the user can still choose or type a name that matches no filter on some platforms, and Runic does not reject such a selection. Validate the content you read. Extensions match case-insensitively on every platform. macOS shows no filter pop-up unless OpenFileOptions.ShowFilterChoice or SaveFileOptions.ShowFilterChoice asks for one: without it, its panel offers the files of every filter at once.
Properties
Extensions
public ImmutableArray<string> Extensions { get; init; } Extensions without the leading dot, or * for every file.
MatchesAllFiles
public bool MatchesAllFiles { get; } Whether the filter matches every file.
MimeTypes
public ImmutableArray<string> MimeTypes { get; init; } MIME types the filter also matches, such as image/png, or image/* for every image; empty by default.
Exceptions
ArgumentExceptionA type is not
type/subtypeortype/*made of MIME token characters.
Remarks
MIME types widen the filter where the dialog matches content types: macOS adds the corresponding uniform type identifiers, and the Linux GTK chooser and xdg-desktop-portal FileChooser match the file's MIME type. Windows filters by extension only and ignores them, so FileDialogFilter.Extensions stays required. Types match without regard to case.
Name
public string Name { get; init; } The name the dialog shows, in the user's language.