編譯器警告 (層級 3) CS0067
更新:2007 年 11 月
錯誤訊息
從未使用事件 '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()
{
}
}