Events

  • Thread starter Thread starter Ferdinand Zaubzer
  • Start date Start date
F

Ferdinand Zaubzer

Hi,
I have a tricky problem with events. I have two objects of the same
type: O1 and O2.
I want to pass the event handlers of O1 (the events of O1 are already
connected to appropriate event handlers) to O2.

Is there any possibility to achieve this?

Regards
Ferdinand
 
Hi,
I have a tricky problem with events. I have two objects of the same
type: O1 and O2.
I want to pass the event handlers of O1 (the events of O1 are already
connected to appropriate event handlers) to O2.

Is there any possibility to achieve this?

Regards
Ferdinand

Hi,

I did not understand your question, can you put an example with some
code?
It does not matter if the objects are of the same class or not. You
simply need to link them

Maybe something like this:


class A{
event EventHandler EventA;
EventHandler HandlerA

public A( EventHandler HandlerA){
this.HandlerA = HandlerA;
}
void methodA(){
console.Write( 1);
}
onA(){
if ( EventA)
EventA(this, null);
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top