By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Changing order of event processing

P: n/a
When I raise an event in an ancestor, the event fires first in the ancestor,
then its descendant, and then in the descendant's descendant.

I would like the descendant's descendant to fire first in one particular
case. How do I accomplish this?
May 5 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Events are fired in the order they are added to the event but they should be
treated as if they are non-deterministic as they very well could be issued
concurrently on multiple threads.

Cheers,

Greg
"Bruce HS" <Br*****@discussions.microsoft.com> wrote in message
news:8D**********************************@microsof t.com...
When I raise an event in an ancestor, the event fires first in the
ancestor,
then its descendant, and then in the descendant's descendant.

I would like the descendant's descendant to fire first in one particular
case. How do I accomplish this?

May 6 '06 #2

P: n/a
This is an unpleasant surprise. In the OO PowerBuilder environment I have
been working in, the ancestor event fires first, and then each descendant, in
order. If your logic requires that you fire a descendant first, you
Override the event in the descendant, and then call the ancestor events if
you want them to process after the the descendant event.

This is a key capability because it allows you to stack layers of logic to
fire predictably. For instance, during a save event, you may want the
ancestor to run general save logic, followed by some specific post-save
process in the descendant. In another case you may want a specific pre-save
process to run before the generic save logic.

Can anyone confirm that there really is no way to do this in VB 2005? If
not, what is the workaround?

"Greg Young" wrote:
Events are fired in the order they are added to the event but they should be
treated as if they are non-deterministic as they very well could be issued
concurrently on multiple threads.

Cheers,

Greg
"Bruce HS" <Br*****@discussions.microsoft.com> wrote in message
news:8D**********************************@microsof t.com...
When I raise an event in an ancestor, the event fires first in the
ancestor,
then its descendant, and then in the descendant's descendant.

I would like the descendant's descendant to fire first in one particular
case. How do I accomplish this?


May 8 '06 #3

P: n/a
As I said the "work around" would be to put them in the right order but this
does not assure you of anything .. The issue is that the events may be run
concurrently on different threads.

Cheers,

Greg
"Bruce HS" <Br*****@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
This is an unpleasant surprise. In the OO PowerBuilder environment I have
been working in, the ancestor event fires first, and then each descendant,
in
order. If your logic requires that you fire a descendant first, you
Override the event in the descendant, and then call the ancestor events if
you want them to process after the the descendant event.

This is a key capability because it allows you to stack layers of logic to
fire predictably. For instance, during a save event, you may want the
ancestor to run general save logic, followed by some specific post-save
process in the descendant. In another case you may want a specific
pre-save
process to run before the generic save logic.

Can anyone confirm that there really is no way to do this in VB 2005? If
not, what is the workaround?

"Greg Young" wrote:
Events are fired in the order they are added to the event but they should
be
treated as if they are non-deterministic as they very well could be
issued
concurrently on multiple threads.

Cheers,

Greg
"Bruce HS" <Br*****@discussions.microsoft.com> wrote in message
news:8D**********************************@microsof t.com...
> When I raise an event in an ancestor, the event fires first in the
> ancestor,
> then its descendant, and then in the descendant's descendant.
>
> I would like the descendant's descendant to fire first in one
> particular
> case. How do I accomplish this?


May 10 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.