I have defined a Foo class and used this in Bar class, with a event handler:
public class Bar
{
public Bar()
{
Foo foo = new Foo();
foo.my_custom_event += my_event_handler;
}
public void my_event_handler()
{
// do work here
}
}
and this works perfectly. But I need to define a method in Foo class that will be fired when I add an event handler to my_custom_event, like:
public class Foo
{
...
public/private void my_event_handler_adder(target_function)
{
functions_that_are_fired_on_my_custom_event.Append(target_function);
}
}
Is there any way to define such an adder method?