Class WeakEvent<T>
Definition
- Assembly:
- Tizen.NUI.dll
The WeakEvent without holding strong reference of event handler.
public class WeakEvent<T> where T : Delegate
- Inheritance
-
objectWeakEvent<T>
Properties
View SourceCount
The count of currently stored event handlers.
Declaration
protected int Count { get; }
Property Value
Type | Description |
---|---|
int |
Methods
View SourceAdd(T)
Adds an event handler to the list of weak references.
Declaration
public virtual void Add(T handler)
Parameters
Type | Name | Description |
---|---|---|
T | handler |
Invoke(object, object)
Invoke event handlers.
Declaration
public void Invoke(object sender, object args)
Parameters
Type | Name | Description |
---|---|---|
object | sender | The source of the event. |
object | args | An object that contains event data. |
OnCountDecreased()
Invoked when the event handler count is decreased.
Declaration
protected virtual void OnCountDecreased()
Remarks
The event handler count decreases when an event handler is removed with Remove(T) or after detecting that it is no longer valid.
OnCountIncreased()
Invoked when the event handler count is increased - a new event handler has been added.
Declaration
protected virtual void OnCountIncreased()
Remove(T)
Remove last stored event handler equal to handler
.
Declaration
public virtual void Remove(T handler)
Parameters
Type | Name | Description |
---|---|---|
T | handler | The event handler to remove. |