NOTE: This property exists only in COM object
(wodAppUp.DLL) version of wodAppUp.
Notification property holds reference to
Notifications interface that can be implemented by
your application. When this property is set, and contains
such a reference, wodAppUpdate 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 Update1_CheckDone(ByVal ErrorCode As
Long, ByVal
ErrorText As String)
End Sub
you will have this:
Private Sub Notifications_CheckDone(ByVal Owner As
wodAppUpdateCOMLib.IwodAppUpdateCom, ByVal ErrorCode As
Long, ByVal
ErrorText As String)
End Sub
pretty much the same - except notification method has
one more argument - Owner, which holds reference to
wodAppUpdate instance that called this method.
In VB, to implement Notifications interface, you
need code like this:
- at the top of the code, in <general> section,
put this:
Dim Update As wodAppUpdateCom
Implements Notifications
- in Form_Load (or where you initialize new instance of
wodAppUpdate) do this:
Set Update = New wodAppUpdateCom
Set Update.Notification =
Me
Update.Check ...
You can notice that when we declared Update, 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!