public sealed record DesktopOpenRegistration : IEquatable<DesktopOpenRegistration> The URL schemes and file types an application registers with the desktop, for the current user.
Parameters
DisplayNameThe application's name, which the desktop shows, such as in its list of applications for a type.
Exceptions
ArgumentExceptionThe display name is empty or contains a control character.
Remarks
A registration makes the application a handler that the desktop offers; it never makes it the default, which stays the user's choice (IDesktopApplications.SetDefaultApplicationAsync). The desktop then starts the application with the file or URL as one argument, which DesktopOpenRequests.FromLaunch reads.
Constructors
DesktopOpenRegistration
public DesktopOpenRegistration(string DisplayName) The URL schemes and file types an application registers with the desktop, for the current user.
Parameters
DisplayNameThe application's name, which the desktop shows, such as in its list of applications for a type.
Exceptions
ArgumentExceptionThe display name is empty or contains a control character.
Remarks
A registration makes the application a handler that the desktop offers; it never makes it the default, which stays the user's choice (IDesktopApplications.SetDefaultApplicationAsync). The desktop then starts the application with the file or URL as one argument, which DesktopOpenRequests.FromLaunch reads.
Properties
DisplayName
public string DisplayName { get; init; } The application's name, which the desktop shows.
Executable
public string? Executable { get; init; } The fully qualified path of the executable the desktop starts; null by default, for Environment.ProcessPath. The desktop passes the file or URL as one quoted argument ("%1" on Windows, %U on Linux). macOS registers the running bundle and ignores it.
Exceptions
ArgumentExceptionThe path is not fully qualified, or contains a quote or a control character.
FileTypes
public ImmutableArray<DesktopFileType> FileTypes { get; init; } File types; empty by default.
Exceptions
ArgumentExceptionA value is
null, or an extension appears twice.
UrlSchemes
public ImmutableArray<string> UrlSchemes { get; init; } URL schemes, such as org.example.notes, by the rules of DesktopOpenOptions.UrlSchemes; empty by default.
Exceptions
ArgumentExceptionA value is not a URL scheme, is
file,httporhttps, or appears twice.