Description
-
Fast notification interface to use instead of
events.
Property type
-
An IwodSSHNotify
object.
Syntax
-
[Set] object.Notification [=
IwodSSHNotify]
The Notification Property syntax has these parts:
Remarks
-
Available only in the Component (DLL, windowless)
version!
The Notification property holds a reference to the IwodSSHNotify
interface that can be implemented by your application. When
this property is set and contains such a reference, wodSSH
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 SSH1_Connected(ByVal ErrorCode
As Integer, ByVal ErrorText As String)
End Sub
-
-
you will have this:
- Private Sub IwodSSHNotify_Connected(ByVal
Owner As WODSSHCOMLib.IwodSSHCom, ByVal ErrorCode As
Integer, ByVal ErrorText As String)
End Sub
-
-
pretty much the same - except the notification method has
one more argument - Owner, which holds a reference to the wodSSH
instance that called this method.
In VB, to implement the IwodSSHNotify interface, you need code
like this:
- at the top of the code, in <general> section, put
this:
Dim Ssh1 As wodSSHCom
Implements
IwodSSHNotify
- in Form_Load (or where you initialize a new instance of
wodSSH) do this:
Set Ssh1 = New wodSSHCom
Set Ssh1.Notification =
Me
Ssh1.Protocol = Telnet
Ssh1.Timeout = 30
Ssh1.Connect
...
You will notice that when we declared SSH, 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!
|