G
Guest
Hi,
I have a class (ClassB) that inherits from another class (ClassA) which has
a delegate and event.
I can see the events from ClassA in an intance object I create of ClassB.
I also subscribe to the event.
The problem is when I check go to "fire" the event in ClassA, the event
evaluates to null as if no one subscribed.
public class ClassA
{
public delegate void DialogAdded(object sender);
public event DialogAdded OnDialogAdded;
public void RaiseEventDialogAdded()
{
//if anyone has subsribed, then notify them
if (OnDialogAdded != null)
{
OnDialogAdded(this);
}
}
}
public class ClassB: ClassA
{
}
objClassB = new ClassB();
objClassB.OnDialogAdded +=new ClassA.DialogAdded(objClassB_OnDialogAdded);
So I subsribe to the inherited event as shown above, but
when I debug the base class (ClassA) , the debugger returns OnDialogAdded
event as null.
Any ideas?
Thanks,
Opa
I have a class (ClassB) that inherits from another class (ClassA) which has
a delegate and event.
I can see the events from ClassA in an intance object I create of ClassB.
I also subscribe to the event.
The problem is when I check go to "fire" the event in ClassA, the event
evaluates to null as if no one subscribed.
public class ClassA
{
public delegate void DialogAdded(object sender);
public event DialogAdded OnDialogAdded;
public void RaiseEventDialogAdded()
{
//if anyone has subsribed, then notify them
if (OnDialogAdded != null)
{
OnDialogAdded(this);
}
}
}
public class ClassB: ClassA
{
}
objClassB = new ClassB();
objClassB.OnDialogAdded +=new ClassA.DialogAdded(objClassB_OnDialogAdded);
So I subsribe to the inherited event as shown above, but
when I debug the base class (ClassA) , the debugger returns OnDialogAdded
event as null.
Any ideas?
Thanks,
Opa