by
cnwrjp1 >> Wed, 14 Jan 2009 21:42:55 GMT
Hi Murray,
I don't think example you show here would work for me as I have an object array with receiver objects, and endnotificationForSubscriber works on the other end of the notification.
The other issue with endNotificationForSubscriber is that I was hoping to only stop the notes on the subscriber for those receiver objects I have been told to manage notifications for, and in some cases, only for specific events. The given subscriber may have other notifications on other receivers which I am not responsible for and I don't want to go terminating notes for those too.
So here is the scenario I was working to.
A form is loaded and a 'notificationHandler' object is created with the form instance set as the subscriber for all notes to be received via it's userNotiy and/or sysNotify methods.
In the process of the form being used, various objects are passed to the notificationHandler with an associated 'notify' event to be either started or stopped.
It was my plan to just store the supplied receiver objects in an array so I could check the given object was already in my array and if it was, I could query the notifications it was subscribed to and either start or stop them depending on the method call. Once the last notification on an object was stopped, I would remove it from the array. When the form unloads or the notificationHandler instance is deleted, I do an 'endNotificationForSubscriber' which should terminate all my notes anyway. From looking at system.getNotes as suggested by Alan I see I can find all the entries where target and subscriber match up to the Objects I am dealing with, but this would seem a rather inefficient way of doing things, especially on a system with a large number of notes. I was hoping there was a way of saying "I will give you a subscriber and receiver and you give me a list of all the notification events registered"
Wishful thinking perhaps?
Roland