class Program
{
public delegate void MyDelatage();
public event MyDelatage MyEvent;
public Program()
{
MyEvent += Fun;
}
public void Fun()
{
Console.WriteLine("Base class");
}
public void RaiseMyEvent()
{
if(MyEvent != null)
MyEvent();
}
}
class Child : Program
{
public void Start()
{
//base.MyEvent();//not allowed
RaiseMyEvent();
}
}
为什么我不能在子类中访问 MyEvent ?