Пример #1
0
 /// <summary>
 /// Creates a new mailbox.
 /// </summary>
 /// <param name="mailbox">The mailbox.</param>
 /// <param name="response">The response.</param>
 /// <returns>The response type.</returns>
 protected override CommandResponseType AddMailboxCommand(Mailbox mailbox, out string response)
 {
     try
     {
         CompletionResponse addMailboxResponse = null;
         if (mailbox.Parent == null)
         {
             addMailboxResponse = _client.AddMailbox(mailbox.Name);
         }
         else
         {
             addMailboxResponse = _client.AddMailbox(mailbox.Name, mailbox.Parent);
         }
         response = addMailboxResponse.Message;
         return(GetCommandResponseType(addMailboxResponse.CompletionResult));
     }
     catch (Exception ex)
     {
         response = ex.ToString();
         return(CommandResponseType.Bad);
     }
 }