Original sender and eventargs

Topics: CAB & Smart Client Software Factory
Oct 20, 2005 at 11:09 AM
originally posted by: mwdiablo

Hi, I needed to know the original sender and eventargs when my events where fired so I changed FireCommand in ln 58 of EventCommandAdaptor.cs to pass along the sender and eventargs.
I then changed FireCommand in CommandAdaptor.cs ln 84 and 88 to do the same and now when my eventcommands fire I get the correct sender and eventargs being passed along.
Is this by design or is it a bug?
Oct 21, 2005 at 5:11 AM
originally posted by: DLorenz

If you declare an event as EventHandler, it automatically takes two parameters: Object sender and EventArgs e. When you raise the event, you should be passing "this" as the sender, so you should be able to just pull the sender out that way?
Oct 21, 2005 at 12:06 PM
originally posted by: mwdiablo

Yea, that is the whole point, have a look at the code in FireCommand in ln 58 of EventCommandAdaptor.cs, the AB does not pass on the sender and eventArgs.

I changed it to do just that:
public void InvokerEventHandler(object sender, EventArgs e)
{
FireCommand(sender, e);
}

So what I want to know is why are the CompositeUI team not passing on the original sender and eventArgs, is there a reason for this?
Oct 25, 2005 at 4:55 AM
originally posted by: DLorenz

Are you sure? I'm checking the sender in a few instances, and it is coming through just fine.