473,394 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Changing order of event processing

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
3 1440
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom | last post by:
Using AccessXP - Access2000 In my application, when an order is entered, inventory is automatically adjusted, a pull list is created, items are pulled to fill the order, and the order is...
4
by: KK | last post by:
Hi All... For my purpose, I need to handle listbox selection changed event.I must be notified before changing occurs and after.After I can handle using SelectedIndexChanged event.Is there anyway...
0
by: Andrew Ducker | last post by:
I currently have a screen with a bunch of panels on it that are made visible one at a time, in order (so that clicking the Next button cycles through them). One of these panels needs to pop up a...
1
by: Adrian Parker | last post by:
At postback time, the controls are all recreated before an event fires. If the event determines that some of the controls need to be replaced with different controls that you can't create as...
1
by: puja | last post by:
hi all, I have this .aspx page for which the Page_load event occurs twice. I found out while debugging. After searching google, I tried checking with Page.Ispostback method and also had...
0
by: Conrad | last post by:
Greetings, For user actions on a wxWidget that trigger multiple events for that wxWidget, is the order those events are processed in undefined, and therefore arbitrary from one platform (ie...
3
by: settyv | last post by:
Hi, I need to generate PDF stream when i click on Linkbutton in datagrid ..At present i hardcoded the DMS Id and now it is working.But i need to pass DMS ID when click linkbutton.How can i do...
3
by: ICPooreMan | last post by:
The following is a very simple example of what I want to do take an elements oncontextmenu and changing it dynamically onclick of that same element. The code below will fail unless you change the...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.