Description
-
Fast notification interface to use instead of
events.
Property type
-
An IwodSFTPNotify
object.
Syntax
-
[Set] object.Notification [=
IwodSFTPNotify]
The Notification Property syntax has these parts:
Remarks
-
Available only in the Component (DLL, windowless)
version!
The Notification property holds a reference to the IwodSFTPNotify
interface that can be implemented by your application. When
this property is set and contains such a reference, wodSFTP
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 Sftp1_Connected(ByVal
ErrorCode As Integer, ByVal ErrorText As String)
End Sub
-
-
you will have this:
- Private Sub IwodSFTPNotify_Connected(ByVal
Owner As WODSFTPCOMLib.IwodSFTPCom, ByVal ErrorCode As
Integer, ByVal ErrorText As String)
End Sub
-
-
Which is more or less the same - except that the notification method has
one more argument - Owner, which holds a reference to the wodSFTP
instance that called this method.
In VB, to implement the IwodSFTPNotify interface, you need code
like this:
- at the top of the code, in the <general> section, put
this:
Dim SFTP As wodSFTPCom
Implements
IwodSFTPNotify
- in Form_Load (or where you initialize a new instance of
wodSFTP) do this:
Set SFTP = New wodSFTPCom
Set SFTP.Notification =
Me
SFTP.Protocol = Telnet
SFTP.Timeout = 30
SFTP.Connect
...
You will notice that when we declared SFTP, we did not use the
WithEvents keyword - it is not needed because
events will not be fired any more. The Notification methods we
implement will be called instead!
|