J
john
Hi,
I have a class that fires an event like this:
class MyClass
{
....
protected override void OnEvent(SomeEventArgs sea)
{
if (MyEvent!=null)
{
MyEvent(this,sea);
}
}
}
There are several subscriber. I want to be able to notify
only selected subscribers of the event, not all of them.
One way is to unsubscribe the unwanted ones, but this is
not an option as it would require more logic. Is there a
way to do some check in this block:
if (MyEvent!=null)
{
if (this is the object I want notified)
{
MyEvent(this,sea);
}
}
Or maybe check the invocation list?
Thanks !
I have a class that fires an event like this:
class MyClass
{
....
protected override void OnEvent(SomeEventArgs sea)
{
if (MyEvent!=null)
{
MyEvent(this,sea);
}
}
}
There are several subscriber. I want to be able to notify
only selected subscribers of the event, not all of them.
One way is to unsubscribe the unwanted ones, but this is
not an option as it would require more logic. Is there a
way to do some check in this block:
if (MyEvent!=null)
{
if (this is the object I want notified)
{
MyEvent(this,sea);
}
}
Or maybe check the invocation list?
Thanks !