wodSSHServer ActiveX Control - Notification Property
      
 

Description

Fast notification interface to use instead of events.


Property type

A wodSSHD-Notifications object.  It must implement IwodSSHD-Notifications interface.


Syntax

[Set] object.Notification [= wodSSHD-Notifications]



The Notification Property syntax has these parts:

Part Description
object An expression evaluating to an object of type wodSSHDCom.
wodSSHD-Notifications A wodSSHD-Notifications object.

Remarks

This method exists only in COM version of wodSSHServer.

Notification property holds reference to IwodSSHD-Notifications interface that can be implemented by your application. When this property is set, and contains such a reference, wodSSHD 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 wodSSHD1_LoginPassword(ByVal User As wodSSHDComLIB.ISSHUser, ByVal Login As String, ByVal Password As String, Action As wodSSHDComLIB.SSHActions)
         ' allow everyone to come in and show that big message
         If Login <> "" Then Action = Allow
End Sub
 

you will have this:

Private Sub IwodSSHD-Notifications_LoginPassword(ByVal Owner As wodSSHDComLIB.IwodSSHDCom, ByVal User As wodSSHDComLIB.ISSHUser, ByVal Login As String, ByVal Password As String, Action As wodSSHDComLIB.SSHActions)
         ' allow everyone to come in and show that big message
         If Login <> "" Then Action = Allow
End Sub

pretty much the same - except notification method has one more argument - Owner, which holds reference to wodSSHD instance that called this method.
In VB, to implement IwodSSHD-Notifications interface, you need code like this:

- at the top of the code, in <general> section, put this:
Dim Sshd As wodSSHDCom
Implements IwodSSHD-Notifications

- in Form_Load (or where you initialize new instance of wodSSH) do this:
Set Sshd = New wodSSHDCom
Set Sshd.Notification = Me
Sshd.Start
...

You can notice that when we declared Ssh, 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!