Share via


컴파일러 오류 CS0066

업데이트: 2007년 11월

오류 메시지

'event': 이벤트는 대리자 형식이어야 합니다.
'event': event must be of a delegate type

이벤트 키워드는 대리자 형식이어야 합니다. 자세한 내용은 이벤트(C# 프로그래밍 가이드)대리자(C# 프로그래밍 가이드)를 참조하십시오.

다음 샘플에서는 CS0066 오류가 발생하는 경우를 보여 줍니다.

// CS0066.cs
using System;

public class EventHandler
{
}

// to fix the error, remove the event declaration and the
// EventHandler class declaration, and uncomment the following line
// public delegate void EventHandler();

public class a
{
   public event EventHandler Click;   // CS0066

   private void TestMethod()
   {
      if (Click != null)
         Click();
   }

   public static void Main()
   {
   }
}