111,089
社区成员




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;
}
}