public sealed record SaveFileOptions : IEquatable<SaveFileOptions> Options for selecting one save destination.
Parameters
SuggestedNameA filename without path separators.
OwnerPolicyThe required dialog ownership;
OwnerPolicy.PreferOwnershows an unowned dialog for a presentation without a native owner.
Constructors
SaveFileOptions
public SaveFileOptions(string SuggestedName, OwnerPolicy OwnerPolicy = OwnerPolicy.RequireOwner) Options for selecting one save destination.
Parameters
SuggestedNameA filename without path separators.
OwnerPolicyThe required dialog ownership;
OwnerPolicy.PreferOwnershows an unowned dialog for a presentation without a native owner.
Properties
Filters
public ImmutableArray<FileDialogFilter> Filters { get; init; } The file types the dialog offers, the first selected initially; empty offers every file.
Exceptions
ArgumentExceptionThe array contains
null.
Remarks
Filters are hints: Runic does not add an extension to the chosen name or reject a name that matches no filter; see FileDialogFilter.
InitialDirectory
public string? InitialDirectory { get; init; } The fully qualified directory the dialog opens in, or null for the platform's choice.
Exceptions
ArgumentExceptionThe path is not fully qualified or contains NUL.
Remarks
A directory that does not exist is ignored by the platform.
OwnerPolicy
public OwnerPolicy OwnerPolicy { get; init; } The required dialog ownership; OwnerPolicy.PreferOwner shows an unowned dialog for a presentation without a native owner.
ShowFilterChoice
public bool ShowFilterChoice { get; init; } Whether macOS adds a pop-up to the panel for choosing one of SaveFileOptions.Filters; false by default.
Remarks
Without it a macOS panel offers the files of every filter at once and reports no Selected.SelectedFilter. With it, the panel shows the first filter's files and the pop-up switches between filters. Windows and Linux always show their own filter choice and ignore this value.
SuggestedName
public string SuggestedName { get; init; } A filename without path separators.
Title
public string? Title { get; init; } The dialog's title, such as "Import backup", or null for the platform's own, such as "Open".
Exceptions
ArgumentExceptionThe title contains NUL.
Remarks
Windows shows it in the dialog's title bar and the xdg-desktop-portal FileChooser and GTK 3 in the dialog's header. A macOS panel has no visible title, so it shows the text as the panel's message above the files.