Share via


AppUriHandlerRegistration.SetAppAddedHostsAsync 메서드

정의

AppxManifest에 이미 정의된 호스트 외에 호스트를 등록합니다.

public:
 virtual IAsyncAction ^ SetAppAddedHostsAsync(IIterable<AppUriHandlerHost ^> ^ hosts) = SetAppAddedHostsAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction SetAppAddedHostsAsync(IIterable<AppUriHandlerHost> const& hosts);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction SetAppAddedHostsAsync(IEnumerable<AppUriHandlerHost> hosts);
function setAppAddedHostsAsync(hosts)
Public Function SetAppAddedHostsAsync (hosts As IEnumerable(Of AppUriHandlerHost)) As IAsyncAction

매개 변수

hosts

IIterable<AppUriHandlerHost>

IEnumerable<AppUriHandlerHost>

등록할 AppUriHandlerHost 개체 집합입니다.

반환

비동기 작업을 나타냅니다.

특성

예제

// 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); 

설명

이 API는 AppxManifest를 통해 등록된 항목을 재정의, 바꾸기 또는 제거하지 않습니다.

적용 대상