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);
}
}
 
Back
Top