HostedEmailManager.BeginGetDomains Method (EventHandler<OperationInvokeEventArgs<String[]>>)
Asynchronous call to retrieve all domains associated with the email host service.
Namespace: Microsoft.WindowsServerSolutions.HostedEmail
Assembly: Wssg.HostedEmailObjectModel (in Wssg.HostedEmailObjectModel.dll)
Syntax
public void BeginGetDomains(
EventHandler<OperationInvokeEventArgs<string[]>> completeHandler
)
public:
void BeginGetDomains(
EventHandler<OperationInvokeEventArgs<array<String^>^>^>^ completeHandler
)
Public Sub BeginGetDomains (
completeHandler As EventHandler(Of OperationInvokeEventArgs(Of String()))
)
Parameters
completeHandler
Type: System.EventHandler<OperationInvokeEventArgs<String[]>>Complete handler for the asynchronous call.
Remarks
The implementation of IHostedEmailAdaptor may or may not support retrieving domains. For more information, see EnableDisableUserSupported.
The result of the method call is passed by the complete handler. The OperationInvokeError<T0>.Error indicates whether there was an exception thrown out during the operation. If this value is not null, the same exception will be thrown when accessing OperationInvokeEventArgs<T0>.Result.
OperationInvokeEventArgs<T0>.Result is string containing the domains.
Examples
The following code sample describes using BeginGetDomains as part of the process of retrieving the domain names. For the complete code sample, see Quickstart: Creating a Hosted Email Adapter.
private void QueryDomainNames()
{
manager.BeginGetDomains((sender, e) =>
{
if (e.Error != null)
{
UpdateDomains(false, true);
}
else
{
domains = e.Result;
UpdateDomains(false, false);
}
});
}
See Also
HostedEmailManager Class
Microsoft.WindowsServerSolutions.HostedEmail Namespace
Return to top