컴파일러 오류 CS0069

업데이트: 2007년 11월

오류 메시지

인터페이스의 이벤트에는 add 또는 remove 접근자를 사용할 수 없습니다.
An event in an interface cannot have add or remove accessors

인터페이스에 이벤트의 접근자 함수를 정의할 수 없습니다. 자세한 내용은 이벤트(C# 프로그래밍 가이드)인터페이스(C# 프로그래밍 가이드)를 참조하십시오.

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

// CS0069.cs
// compile with: /target:library

public delegate void EventHandler();

public interface a
{
   event EventHandler Click { remove {} }   // CS0069
   event EventHandler Click2;   // OK
}