Dela via


AppUriHandlerRegistration Class

Definition

Sets and retrieves dynamic AppUriHandlerHost entries for a given AppUriHandler registration.

public ref class AppUriHandlerRegistration sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 458752)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class AppUriHandlerRegistration final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 458752)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class AppUriHandlerRegistration
Public NotInheritable Class AppUriHandlerRegistration
Inheritance
Object Platform::Object IInspectable AppUriHandlerRegistration
Attributes

Windows requirements

Device family
Windows 10, version 1809 (introduced in 10.0.17763.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v7.0)

Examples

string uriHandlerName = "Runtime"; 
Windows.System.AppUriHandlerRegistrationManager manager = AppUriHandlerRegistrationManager.GetDefault(); // Or GetForUser() for multi user-aware apps. 
AppUriHandlerRegistration registration = manager.TryGetRegistration(uriHandlerName);
if (registration != null)
{
    // App can get or set hosts as needed
}

Remarks

Registrations follow the same structure as entries in the AppxManifest:

<uap3:Extension Category="windows.appUriHandler">
    <uap3:AppUriHandler uap7:Name ="Runtime">
        <uap3:Host Name="appurihandler.example.com" />
    </uap3:AppUriHandler>
</uap3:Extension>

Properties

Name

The name of the registration.

PackageFamilyName

Gets the package family name for the app originally specified when creating the associated AppUriHandlerRegistrationManager object.

User

The user context of this registration.

Methods

GetAllHosts()

Retrieves the set of all hosts including those added programmatically with SetAppAddedHostsAsync and those registered statically in the app manifest.

GetAppAddedHostsAsync()

Retrieves the set of hosts added by SetAppAddedHostsAsync for the given registration.

SetAppAddedHostsAsync(IIterable<AppUriHandlerHost>)

Registers hosts in addition to the hosts already defined in the AppxManifest.

UpdateHosts(IIterable<AppUriHandlerHost>)

Updates all the app URI registrations specified in the collection.

Applies to

See also