NOTE: This property is available only in COM
version of wodPop3Server.
Notification property holds reference to IwodPop3Notify
interface that can be implemented by your application. When
this property is set, and contains such a reference,
wodPop3Server 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 Pop3_Connected(ByVal User As
WODPOP3SERVERCOMLib.IPop3User, ByVal Username As
String, ByVal Password As
String, Action As WODPOP3SERVERCOMLib.Pop3Actions)
End Sub
you will have this:
Private Sub IwodPop3Notify_Connected(ByVal Owner As
WODPOP3SERVERCOMLib.IwodPop3ServerCom, ByVal User As
WODPOP3SERVERCOMLib.IPop3User, ByVal Username As
String, ByVal Password As
String, Action As WODPOP3SERVERCOMLib.Pop3Actions)
End Sub
pretty much the same - except notification method has
one more argument - Owner, which
holds reference to wodPop3Server instance that called this
method.
In VB, to implement IwodPop3Notify interface, you need
code like this:
- at the top of the code, in <general> section,
put this:
Dim Pop3 As wodPop3ServerCom
Implements IwodPop3Notify
- in Form_Load (or where you initialize new instance of
wodPop3Server) do this:
Set Pop3 = New wodPop3ServerCom
Set Pop3.Notification =
Me
Pop3.Port = 25
Pop3.Start
'...
You can notice that when we declared Pop3, 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!