Class CLREventData
Base class for event information. Extend this to manage event associated data
public class CLREventData : IDisposable
- Inheritance
-
CLREventData
- Implements
- Derived
- Inherited Members
- Extension Methods
Examples
The following is the implementation of the Java EventObject class.
It will be used as typeparam of CLRListenerEventArgs<TDataClass> for the event CLRActionListener
public class CLREventObjectData : CLREventData
{
public CLREventObjectData(object actionData)
: base(actionData)
{
}
public dynamic Source { get { return DynEventData.getSource(); } }
public override string ToString()
{
return DynEventData.toString();
}
}
Constructors
CLREventData(IJavaObject)
Initialize a new instance of CLREventData
public CLREventData(IJavaObject reference)
Parameters
referenceIJavaObjectInformation about event information, it is automatically set from the sub-system.
Properties
DoNotDisposeEventData
Override to return true to prevent automatic disposal of EventData when Dispose() is called on this instance. Default is false.
protected virtual bool DoNotDisposeEventData { get; }
Property Value
Remarks
Return true when the EventData content must remain valid beyond the lifecycle of this instance, for example when it is referenced externally.
DynEventData
Dynamic accessor to the information about event information received from the JVM
public dynamic DynEventData { get; }
Property Value
- dynamic
DynExtraData
A dynamic array of extra information ordered with the same order of the caller, or null if HasExtraData is false
public dynamic DynExtraData { get; }
Property Value
- dynamic
EventData
Accessor to the information about event information received from the JVM
public virtual object EventData { get; }
Property Value
ExtraData
An array of extra information ordered with the same order of the caller, or null if HasExtraData is false
public IJavaArray ExtraData { get; }
Property Value
ExtraDataLength
Returns how many object contains extra information.
public int ExtraDataLength { get; }
Property Value
HasExtraData
True if the event has other objects associated
public bool HasExtraData { get; }
Property Value
this[int]
Returns the indexed IJavaObject
public IJavaObject this[int index] { get; }
Parameters
indexintThe index to get
Property Value
- IJavaObject
The IJavaObject at
index
Exceptions
- InvalidOperationException
If there are any extra information to retrieve
- ArgumentOutOfRangeException
If the index is out of the possible indexes
Methods
CheckDisposed()
Test if this instance was disposed
protected void CheckDisposed()
Exceptions
- ObjectDisposedException
When this instance was disposed
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Implements the pattern described in https://learn.microsoft.com/en-en/dotnet/standard/garbage-collection/implementing-dispose
protected virtual void Dispose(bool disposing)
Parameters
disposingboolThe disposing parameter is a bool that indicates whether the method call comes from a Dispose() method (its value is true) or from a finalizer (its value is false)
~CLREventData()
Finalizer
protected ~CLREventData()
GetAt(int)
Returns the indexed IJavaObject
public IJavaObject GetAt(int index)
Parameters
indexintThe index to get
Returns
- IJavaObject
The IJavaObject at
index
Exceptions
- InvalidOperationException
If there are any extra information to retrieve
- ArgumentOutOfRangeException
If the index is out of the possible indexes