PowerTCP Mail for .NET
MailboxEventArgs Class
Members  Example  See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace : MailboxEventArgs Class




Provides data for the Imap.EndMailboxAdd, Imap.EndList, and Imap.Mailbox events.

Object Model

MailboxEventArgs ClassMailbox ClassMailbox Class

Syntax

Visual Basic (Declaration) 
Public Class MailboxEventArgs 
   Inherits EndEventArgs
Visual Basic (Usage)Copy Code
Dim instance As MailboxEventArgs
C# 
public class MailboxEventArgs : EndEventArgs 
Managed Extensions for C++ 
public __gc class MailboxEventArgs : public EndEventArgs 
C++/CLI 
public ref class MailboxEventArgs : public EndEventArgs 

Example

The following example demonstrates asynchronously creating a new mailbox.
Visual BasicCopy Code
private void AsynchronousMailboxCreateTest()
{
   ' Login to the server.
   Imap1.Login(Server, User, Pass)

   ' Begin to asynchronously create a new mailbox. When
   ' complete, the Imap.EndMailboxAdd event will be raised.
   Imap1.Mailboxes.BeginAdd("MyNewMailbox", Nothing)
}

Private Sub Imap1_EndMailboxAdd(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.MailboxEventArgs) Handles Imap1.EndMailboxAdd
   If e.Exception Is Nothing Then
      Debug.WriteLine("New mailbox " + e.Mailbox.Name + " created.")
   Else
      Debug.WriteLine("Exception received: " + e.Exception.Message)
   End If
End Sub
C#Copy Code
private void AsynchronousMailboxCreateTest()
{
   // Login to the server.
   imap1.Login(Server, User, Pass);

   // Begin to asynchronously create a new mailbox. When
   // complete, the Imap.EndMailboxAdd event will be raised.
   imap1.Mailboxes.BeginAdd("MyNewMailbox", null);
}

private void imap1_EndMailboxAdd(object sender, Dart.PowerTCP.Mail.MailboxEventArgs e)
{
   if(e.Exception == null)
      Debug.WriteLine("New mailbox " + e.Mailbox.Name + " created.");
   else
      Debug.WriteLine("Exception received: " + e.Exception.Message);
}

Remarks

This class provides data for any event which marks the completion or progress of any asynchronous method which manipulates or gathers information about IMAP mailboxes.

If multiple mailboxes are effected, these mailboxes will be part of the MailboxEventArgs.Mailboxes property. MailboxEventArgs.Mailbox will reflect the first mailbox effected. For this reason, MailBoxEventArgs.Mailbox will always equal MailboxEventArgs.Mailboxes[0].

If any error occurred during the asynchronous operation, it would be returned in the EndEventArgs.Exception property. Be sure to check this property first before accessing other members of MailBoxEventArgs.

Inheritance Hierarchy

System.Object
   System.EventArgs
      Dart.PowerTCP.Mail.EndEventArgs
         Dart.PowerTCP.Mail.MailboxEventArgs

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.