Click or drag to resize

CLRListener Class

Note: This API is now obsolete.

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.4.14.220818-82c2bf79b6e60a4d98fb4d1695305d68a91adf44
Syntax
[ObsoleteAttribute("Will be removed in future versions. Use JVMBridgeListener instead")]
public class CLRListener : ICLRListener, 
	IJVMBridgeBase, IJVMBridgeDefinition, IDisposable

The CLRListener type exposes the following members.

Constructors
  NameDescription
Public methodCLRListener
Initialize a new instance of CLRListener
Top
Properties
  NameDescription
Public propertyAutoInit
Set to to externally initialize this CLRListener instance using InitializeListener(IJVMBridgeBase)
Public propertyClassName
Java class name to be instantiated
Public propertyDynInstance
The dynamic accessor to Instance
Public propertyDynListener Obsolete.
Local reference for JVM Listener, it shall be used as input for all Java methods which need the interface e.g. addActionListener
Public propertyInstance
The IJavaObject instance
Public propertyIsAbstract
if the ClassName is an abstract class, i.e. cannot be created an instance
Public propertyIsCloseable
if the ClassName implements Closeable
Public propertyIsInterface
if the ClassName is an interface, i.e. does not have any public constructor
Public propertyIsListener
if the ClassName follows the listener pattern of JCOBridge: the ClassName extends a JCListener or implements IJCListener
Public propertyIsStatic
if the ClassName is a static class, i.e. does not have any public constructor
Public propertyJniClass Obsolete.
Represents the class implemented in JVM context
Public propertyListener Obsolete.
Local reference for JVM JCListener instance, it shall be used as input for all Java methods which need the interface e.g. addActionListener
Top
Methods
  NameDescription
Protected methodAddEventHandler(String, EventHandler)
Adds an handler to manage events from JVM
Protected methodAddEventHandlerTDataClass(String, EventHandlerCLRListenerEventArgsTDataClass)
Adds an handler to manage events from JVM
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
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
Extension Methods
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 override string ClassName { get { return "org.mases.jcobridge.specialized.JCActionListener"; } } // the full name of class, in the JVM counterpart, of the Java class implementing the event

    public CLRActionListener(EventHandler<CLRListenerEventArgs<CLRActionEventData>> handler) // the handler with the expected type
    {
        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