PowerTCP Mail for .NET
Mailboxes Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > MailboxEventArgs Class : Mailboxes Property




Gets an array of Mailbox objects representing all mailboxes effected by the operation.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Mailboxes As Mailbox()
Visual Basic (Usage)Copy Code
Dim instance As MailboxEventArgs
Dim value() As Mailbox
 
value = instance.Mailboxes
C# 
public Mailbox[] Mailboxes {get;}
Managed Extensions for C++ 
public: __property Mailbox*[]* get_Mailboxes();
C++/CLI 
public:
property array<Mailbox^>^ Mailboxes {
   array<Mailbox^>^ get();
}

Property Value

Returns an array of Mailbox objects.

Example

The following example demonstrates performing an asynchronous listing.
Visual BasicCopy Code
Private Sub AsynchronousListTest()
   ' Set Autolist to false. We will explicitly call for a listing.
   Imap1.AutoList = False

   ' Login to the server.
   Imap1.Login(Server, User, Pass)

   ' Begin an asynchronous listing.
   Imap1.BeginList(Nothing)
End Sub

Private Sub Imap1_EndList(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.MailboxEventArgs) Handles Imap1.EndList
   If e.Exception Is Nothing Then
      Debug.WriteLine("The following mailboxes were reported.")
      Dim Box As Mailbox
      For Each Box In E.Mailboxes
         Debug.WriteLine(Box.Name)
      End If
   End If
End Sub
C#Copy Code
private void AsynchronousListTest()
{
   // Set Autolist to false. We will explicitly call for a listing.
   imap1.AutoList = false;

   // Login to the server.
   imap1.Login(Server, User, Pass);

   // Begin an asynchronous listing.
   imap1.BeginList(null);
}

private void imap1_EndList(object sender, Dart.PowerTCP.Mail.MailboxEventArgs e)
{
   if(e.Exception == null)
   {
      Debug.WriteLine("The following mailboxes were reported.");
      foreach(Mailbox box in e.Mailboxes)
         Debug.WriteLine(box.Name);
   }
}

Remarks

If it is expected that multiple mailboxes are effected, iterate through this collection to access each mailbox. If it is expected that a single mailbox is effected, access MailboxEventArgs.Mailboxes[0] or simply access the MailboxEventArgs.Mailbox property, which contains the first mailbox effected.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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