Click or drag to resize

CLRListener Class

Base class managing events from JVM. Implements ICLRListener. Extend this base class to manage events from the JVM
Inheritance Hierarchy
SystemObject
  MASES.JCOBridge.C2JBridgeCLRListener
    More...

Namespace:  MASES.JCOBridge.C2JBridge
Assembly:  C2JBridge (in C2JBridge.dll) Version: 2.3.2.210304-f3821f45d93542a4fb34c013ca105a6afd2f10a2
Syntax
public class CLRListener : ICLRListener

The CLRListener type exposes the following members.

Constructors
  NameDescription
Public methodCLRListener
Initialize a new instance of CLRListener
Top
Properties
  NameDescription
Public propertyDynListener
Local reference for JVM Listener, it shall be used as input for all Java methods which need the interface e.g. addActionListener
Top
Methods
  NameDescription
Protected methodAddEventHandlerTDataClass
Adds an handler to manage events from JVM
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
The following is the implementation of the Java ActionListener interface managed from the object JCActionListener (see Java help for implementation)
It use CLRActionEventData as typeparam of the generic CLRListenerEventArgsTDataClass
C#
public sealed class CLRActionListener : CLRListener
{
    public CLRActionListener(EventHandler<CLRListenerEventArgs<CLRActionEventData>> handler) // the handler with the expected type
        : base("org.mases.jcobridge.specialized.JCActionListener") // the full name of class, in the JVM counterpart, of the Java class implementing the event
    {
        AddEventHandler("actionPerformed", handler); // allocate the event handler associated to the action the Java interface to be managed in C#
    }
}
See Also
Inheritance Hierarchy
SystemObject
  MASES.JCOBridge.C2JBridgeCLRListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRActionListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRAdjustmentListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRAWTEventListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRCaretListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRChangeListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRComponentListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRConnectionEventListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRDragGestureListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRDragSourceAdapter
    MASES.JCOBridge.C2JBridge.SpecializedCLRDropTargetListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRFocusListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRInputMethodListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRItemListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRKeyListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRMouseAdapter
    MASES.JCOBridge.C2JBridge.SpecializedCLRMouseInputAdapter
    MASES.JCOBridge.C2JBridge.SpecializedCLRObjectChangeListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRPropertyChangeListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRTextListener
    MASES.JCOBridge.C2JBridge.SpecializedCLRWindowAdapter