NOTE: This property is available only in COM
version of wodImapServer.
Notification property holds reference to IwodImapNotify
interface that can be implemented by your application. When
this property is set, and contains such a reference,
wodImapServer will call your method implementations instead
of firing events. More information on how this works can be
found here.
For example, instead of having this in your code (VB
example):
Private Sub Imap1_Connected(ByVal User As
WODIMAPSERVERCOMLib.IImapUser, ByVal Username As String,
ByVal Password As String, Action As
WODIMAPSERVERCOMLib.ImapActions)
End Sub
you will have this:
Private Sub IwodImapNotify_Connected(ByVal
Owner As WODIMAPSERVERCOMLib.IwodImapServerCom, ByVal User
As WODIMAPSERVERCOMLib.IImapUser, ByVal Username As String,
ByVal Password As String, Action As
WODIMAPSERVERCOMLib.ImapActions)
End Sub
pretty much the same - except notification method has
one more argument - Owner, which holds reference to
wodImapServer instance that called this method.
In VB, to implement IwodImapNotify interface, you need code
like this:
- at the top of the code, in <general> section, put
this:
- Dim Imap1 As
wodImapServerCom
Implements IwodImapNotify
- in Form_Load (or where you initialize new instance of
wodImapServer) do this:
Set Imap1 = New
wodImapServerCom
Set
Imap1.Notification = Me
Imap1.Port = 143
Imap1.Start
...
You can notice that when we declared Imap, we did not
use WithEvents keyword - it is not
needed anymore, because events will not be fired anymore.
Notification methods we implement will be called
instead!