axnst2
asked on
abstract events
Hi Experts,
When I try to compile the attached code, I get the following errors:
<'CMyClass' does not implement inherited abstract member 'CMyBaseClass.ErrorEvent.a dd'>
Also, when I go to add the "ErrorEvent" event in CMyClass, the event doesn't come up on the list of available events.
Any ideas?
When I try to compile the attached code, I get the following errors:
<'CMyClass' does not implement inherited abstract member 'CMyBaseClass.ErrorEvent.a
Also, when I go to add the "ErrorEvent" event in CMyClass, the event doesn't come up on the list of available events.
Any ideas?
abstract class CMyBaseClass
{
protected delegate void ErrorEventDelegate(string error);
protected abstract event ErrorEventDelegate ErrorEvent;
}
class CMyClass : CMyBaseClass
{
public CMyClass()
{
base.ErrorEvent += new ErrorEventDelegate(CMyClass_ErrorEvent);
}
void CMyClass_ErrorEvent(string error)
{
throw new Exception("The method or operation is not implemented.");
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER