我有以下课程:
public abstract class CommonEvents : DisposableObject
{
/// <summary>
/// Internal method for storing error messages to our event
/// </summary>
/// <param name="message"></param>
/// <param name="showException"></param>
/// <param name="exception"></param>
public void OnError(string message, OnErrorEventsArgs.ShowExceptionLevel showException, Exception exception)
{
if (_onErrorEvent == null) return;
var e = new OnErrorEventsArgs(message, showException, exception);
_onErrorEvent(this, e);
}
/// <summary>
/// Internal event handler allowing for logging of events within the class
/// </summary>
private EventHandler<OnErrorEventsArgs> _onErrorEvent;
/// <summary>
/// Public event handler allowing for accessibility outside of the class
/// </summary>
public event EventHandler<OnErrorEventsArgs> OnErrorEvent
{
add { _onErrorEvent += value; }
remove { _onErrorEvent += value; }
}
}
我正在尝试在我的一个项目中继承它,但是我已经在那里继承了另一个类,代码如下:
public class ItemDal : Common.Dal.BaseDal, CommonEvents
{
我收到的错误是
'CommonEvents':预期接口名称
当我对此进行研究时,我尝试构建一个界面 - 但由于我对完成这一点的了解不够多,所以结果很短。您能否帮助我理解这一点,或者为我指出一篇好文章的方向以帮助我这样做?