更新:2007 年 11 月
错误消息
事件“event”只能出现在 += 或 -= 的左边(从类型“type”中使用时除外)
在定义事件的类的外部,event 只能加上或减去引用。有关更多信息,请参见事件(C# 编程指南)。
下面的示例生成 CS0070:
// CS0070.cs
using System;
public delegate void EventHandler();
public class A
{
   public event EventHandler Click;
   public static void OnClick()
   {
      EventHandler eh;
      A a = new A();
      eh = a.Click;
   }
   public static void Main()
   {
   }
}
public class B
{
   public int Foo ()
   {
      EventHandler eh = new EventHandler(A.OnClick);
      A a = new A();
      eh = a.Click;   // CS0070
      // try the following line instead
      // a.Click += eh;
      return 1;
   }
}