Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
xojo:objectnotifier:start [2021/04/06 08:41] mz |
xojo:objectnotifier:start [2021/04/06 09:27] (aktuell) mz [Object notification] |
||
---|---|---|---|
Zeile 20: | Zeile 20: | ||
Simply instantiate this class and call their members like: | Simply instantiate this class and call their members like: | ||
- | + | Declare: | |
- | | + | |
private property onb as ObjectNotifierBox | private property onb as ObjectNotifierBox | ||
- | ----- | + | in //Constructor// Method: |
- | | + | |
onb = new ObjectNotifierBox | onb = new ObjectNotifierBox | ||
- | ----- | + | Actual implementation of the // |
- | Method: | + | |
Sub addObjectNotificationReceiver(receiver as objectNotificationReceiver, | Sub addObjectNotificationReceiver(receiver as objectNotificationReceiver, | ||
| | ||
End Sub | End Sub | ||
- | + | ||
- | Method: | + | |
Sub removeObjectNotificationReceiver(receiver As objectNotificationReceiver) | Sub removeObjectNotificationReceiver(receiver As objectNotificationReceiver) | ||
| | ||
End Sub | End Sub | ||
- | For calling all receivers write: | + | For calling all subscribed |
onb.callReceivers(me) | onb.callReceivers(me) | ||
Zeile 43: | Zeile 39: | ||
Instead of " | Instead of " | ||
+ | <WRAP round important 100%> | ||
+ | Be careful with // | ||
+ | < | ||
+ | xy.addObjectNotificationReceiver(me, | ||
+ | xy.addObjectNotificationReceiver(me, | ||
+ | </ | ||
+ | Because // | ||
+ | It's therefore not possible to delete only the second entry (with //info// 2). | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Sourcecode ====== | ||
{{ : | {{ : | ||
Zeile 102: | Zeile 112: | ||
Properties | Properties | ||
| | ||
- | mInfos() As Variant | + | |
- | mReceivers() As objectNotificationReceiver | + | |
| | ||
End Class | End Class |