PropertyChangeSupport is a utility class to support maintaining property listeners, keyed by property name.
More...
PropertyChangeSupport is a utility class to support maintaining property listeners, keyed by property name.
Apama.Util.PropertyChangeSupport.PropertyChangeSupport |
( |
object |
sender | ) |
|
Create a new PropertyChangeSupport, initialized with the specified sender object
- Parameters
-
sender | The object that will be specified as the sender of all property change notification fired by this class. |
Add a PropertyChangeListener to the listener list. The listener is registered for all properties. The same listener object may be added more than once, and will be called as many times as it is added. If
listener
is null, no exception is thrown and no action is taken.
- Parameters
-
listener | The PropertyChangedEventHandler to be added |
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on FirePropertyChange names that specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property. If
propertyName
or listener
is null, no exception is thrown and no action is taken.
- Parameters
-
propertyName | The name of the property to listen on. |
listener | The PropertyChangeListener to be added |
virtual void Apama.Util.PropertyChangeSupport.Clear |
( |
| ) |
|
|
virtual |
Remove all references to listeners.
virtual void Apama.Util.PropertyChangeSupport.FireChange |
( |
string |
propertyName, |
|
|
object |
oldValue, |
|
|
object |
newValue |
|
) |
| |
|
virtual |
Report a bound property update to any registered listeners. No event is fired if old and new are equal and non-null.
- Parameters
-
propertyName | The programmatic name of the property that was changed. |
oldValue | The old value of the property. |
newValue | The new value of the property. |
Fire an existing PropertyChangedEventArgs to any registered listeners. No event is fired if the given event's old and new values are equal and non-null.
- Parameters
-
evt | The PropertyChangeEventArgs object. |
bool Apama.Util.PropertyChangeSupport.HasListeners |
( |
string |
propertyName | ) |
|
Returns true if there is any listener that would fire as a result of the specified propertyName changing.
- Parameters
-
- Returns
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. If
listener
was added more than once to the same event source, it will be notified one less time after being removed. If listener
is null, or was never added, no exception is thrown and no action is taken.
- Parameters
-
listener | The PropertyChangeListener to be removed |
virtual void Apama.Util.PropertyChangeSupport.RemovePropertyChangeListener |
( |
string |
propertyName, |
|
|
PropertyChangedEventHandler |
listener |
|
) |
| |
|
virtual |
Remove a PropertyChangeListener for a specific property. If
listener
was added more than once to the same event source for the specified property, it will be notified one less time after being removed. If propertyName
is null, no exception is thrown and no action is taken. If listener
is null, or was never added for the specified property, no exception is thrown and no action is taken.
- Parameters
-
propertyName | The name of the property that was listened on. |
listener | The PropertyChangeListener to be removed |