{
}
+ /// <summary>
+ /// reates and initializes a new instance of the SmartEvent class.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="handle">Teh event handler.</param>
+ /// <param name="eventName">The event name.</param>
+ /// <param name="parser">The event parser.</param>
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
public SmartEvent(EvasObject sender, IntPtr handle, string eventName, SmartEventInfoParser parser)
{
{
}
+ /// <summary>
+ /// Destroy the SmartEvent object.
+ /// </summary>
~SmartEvent()
{
Dispose(false);
}
}
+ /// <summary>
+ /// Destroy current object
+ /// </summary>
public void Dispose()
{
Dispose(true);
_handle = IntPtr.Zero;
}
+ /// <summary>
+ /// Releases all resources currently used by this instance.
+ /// </summary>
+ /// <param name="disposing">
+ /// true if managed resources should be disposed
+ /// otherwise, false.
+ /// </param>
protected virtual void Dispose(bool disposing)
{
if (disposing)
/// This way, you can extend EvasObject's own <see cref="EvasObjectEvent"/>.
/// They are defined by an event string, which identifies them uniquely.
/// </summary>
- /// <typeparam name="TEventArgs">The parameter for the event.</typeparam>
public class SmartEvent : IInvalidatable
{
private SmartEvent<EventArgs> _smartEvent;
+
private event EventHandler _handlers;
/// <summary>
{
}
+ /// <summary>
+ /// Creates and initializes a new instance of the SmartEvent class.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="handle">The event handler.</param>
+ /// <param name="eventName">The event name.</param>
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
public SmartEvent(EvasObject sender, IntPtr handle, string eventName)
{
_smartEvent = new SmartEvent<EventArgs>(sender, handle, eventName, null);
}
+ /// <summary>
+ /// Destroy the SmartEvent object.
+ /// </summary>
~SmartEvent()
{
Dispose(false);
_handlers?.Invoke(sender, e);
}
+ /// <summary>
+ /// Destroy current object
+ /// </summary>
public void Dispose()
{
Dispose(true);
_smartEvent.MakeInvalidate();
}
+ /// <summary>
+ /// Releases all resources currently used by this instance.
+ /// </summary>
+ /// <param name="disposing">
+ /// true if managed resources should be disposed
+ /// otherwise, false.
+ /// </param>
protected virtual void Dispose(bool disposing)
{
if (disposing)
}
}
}
-}
+}
\ No newline at end of file