Partager via


HostedEmailManager.BeginGetAllAccounts Method (EventHandler<OperationInvokeEventArgs<EmailAccountInfo[]>>)

 

Asynchronous call to retrieve all email accounts.

Namespace:   Microsoft.WindowsServerSolutions.HostedEmail
Assembly:  Wssg.HostedEmailObjectModel (in Wssg.HostedEmailObjectModel.dll)

Syntax

public void BeginGetAllAccounts(
    EventHandler<OperationInvokeEventArgs<EmailAccountInfo[]>> completeHandler
)
public:
void BeginGetAllAccounts(
    EventHandler<OperationInvokeEventArgs<array<EmailAccountInfo^>^>^>^ completeHandler
)
Public Sub BeginGetAllAccounts (
    completeHandler As EventHandler(Of OperationInvokeEventArgs(Of EmailAccountInfo()))
)

Parameters

Remarks

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 contains an array of email accounts.

Examples

The following code sample describes using BeginGetAllAccounts as part of the process of determining how many mail boxes there are on the server. For the complete code sample, see Quickstart: Creating a Hosted Email Adapter.

private void QueryMailboxNumber()
 {
     manager.BeginGetAllAccounts((sender, e) =>
     {
         if (e.Error != null)
         {
             UpdateMailBoxNumber(false, true);
         }
         else
         {
             emailAccountsInfo = e.Result;
             UpdateMailBoxNumber(false, false);
         }
     });
 }

See Also

HostedEmailManager Class
Microsoft.WindowsServerSolutions.HostedEmail Namespace

Return to top