“event”: 抽象事件不能有初始值设定项
如果 event 被标记为 抽象,则无法将其初始化。 有关详细信息,请参阅事件。
下面的示例生成 CS0074:
// CS0074.cs
delegate void D();
abstract class Test
{
public abstract event D e = null; // CS0074
// try the following line instead
// public abstract event D e;
public static void Main()
{
}
}