AppUriHandlerRegistration.GetAppAddedHostsAsync Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mengambil set host yang ditambahkan oleh SetAppAddedHostsAsync untuk pendaftaran yang diberikan.
public:
virtual IAsyncOperation<IVector<AppUriHandlerHost ^> ^> ^ GetAppAddedHostsAsync() = GetAppAddedHostsAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVector<AppUriHandlerHost>> GetAppAddedHostsAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IList<AppUriHandlerHost>> GetAppAddedHostsAsync();
function getAppAddedHostsAsync()
Public Function GetAppAddedHostsAsync () As IAsyncOperation(Of IList(Of AppUriHandlerHost))
Mengembalikan
Kumpulan host terakhir ditambahkan oleh SetAppAddedHostsAsync.
- Atribut
Contoh
// Application logic can determine which are the new domains to register
// Here we just have a hardcoded list.
List<AppUriHandlerHost> hosts = await registration.GetAppAddedHostsAsync();
// Application logic can determine which are the new domains to register
hosts.AddRange(new[] {
new AppUriHandlerHost("www.contoso.com"),
new AppUriHandlerHost("*.example.contoso.com")
});
// Application logic can determine which domains to remove from the list
hosts.RemoveAll(_ => _.Name == "removed.contoso.com");
await registration.SetAppAddedHostsAsync(hosts);
Keterangan
Set ini tidak termasuk host yang ditentukan dalam AppxManifest.