110,533
社区成员
发帖
与我相关
我的任务
分享
using system;
namespace EventHandler
{
public delegate int RunHandler(object sender, EventArgs e);
}
using System;
using EventHandler;
namespace Test
{
public class A
{
protected event RunHandler OnBeforeFunctionRun;
protected virtual int ExecuteSubFunction(object sender, EventArgs e)
{
return 0;
}
}
}
using System;
using Test;
using EventHandler;
namespace txt
{
public class B : A
{
protected override int ExecuteSubFunction(object sender, EventArgs e)
{
if (this.OnBeforeFunctionRun != null)
{
int iRetValue = OnBeforeFunctionRun(sender, e);
if (iRetValue != 0)
{
return iRetValue;
}
else
{
return -1;
}
}
}
}
}
public class A
{
//protected event RunHandler OnBeforeFunctionRun;
protected RunHandler OnBeforeFunctionRun;
protected virtual int ExecuteSubFunction(object sender, EventArgs e)
{
return 0;
}
}