编译器警告(等级 3)CS0067
更新:2007 年 11 月
错误消息
从未使用过事件“event”
声明了 event,但它从未在声明它的类中使用。
下面的示例生成 CS0067:
// CS0067.cs
// compile with: /W:3
using System;
delegate void MyDelegate();
class MyClass
{
public event MyDelegate evt; // CS0067
// uncomment TestMethod to resolve this CS0067
/*
private void TestMethod()
{
if (evt != null)
evt();
}
*/
public static void Main()
{
}
}