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




Gets any text returned by the server indicating the action of the response.

Syntax

Visual Basic (Declaration) 
Public Property Operation As String
Visual Basic (Usage)Copy Code
Dim instance As ImapResponse
Dim value As String
 
instance.Operation = value
 
value = instance.Operation
C# 
public string Operation {get; set;}
Managed Extensions for C++ 
public: __property string* get_Operation();
public: __property void set_Operation( 
   string* value
);
C++/CLI 
public:
property String^ Operation {
   String^ get();
   void set (    String^ value);
}

Property Value

The text indicating the action if returned; otherwise an empty string.

Example

The following example demonstrates using the LineReceived event to detect values of RECENT and EXISTS responses.
Visual BasicCopy Code
Private Sub ExamineTest()
   ' Login to the server.
   Imap1.Login(Server, User, Pass)

   ' Examine a mailbox.
   Dim Response As ImapResponse = Imap1.Examine("TestBox")

   ' Display the entire response from the server.
   Debug.WriteLine("Entire response from server: " + Response.ToString())
End Sub

Private Sub Imap1_LineReceived(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.ImapResponseEventArgs) Handles Imap1.LineReceived
   Dim Response As ImapResponse
   For Each Response in e.Responses
      If Response.Operation = "EXISTS" Then
         Debug.WriteLine("Value of EXISTS: " + Response.Value)
      End If
      If Response.Operation = "RECENT" Then
         Debug.WriteLine("Value of RECENT: " + Response.Value)
      End If
   Next
End Sub
C#Copy Code
private void ExamineTest()
{
   // Login to the server.
   imap1.Login(Server, User, Pass);

   // Examine a mailbox.
   ImapResponse response = imap1.Examine("TestBox");

   // Display the entire response from the server.
   Debug.WriteLine("Entire response from server: " + response.ToString());
}

private void imap1_LineReceived(object sender, Dart.PowerTCP.Mail.ImapResponseEventArgs e)
{
   foreach(ImapResponse response in e.Responses)
   {
      if(response.Operation == "EXISTS")
         Debug.WriteLine("Value of EXISTS: " + response.Value);
      if(response.Operation == "RECENT")
         Debug.WriteLine("Value of RECENT: " + response.Value);
   }
}

Remarks

This property returns any text returned by the server indicating the action associated with this response. For example, if the following line was received from the IMAP server,

* CAPABILITY IMAP4 IMAP4rev1 AUTH=CRAM-MD5 AUTH=PLAIN AUTH=LOGIN

the ImapResponse.Operation property would contain "CAPABILITY". This information is not included with all responses from the server.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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