Edit

Share via


Compiler Error CS0069

An event in an interface cannot have add or remove accessors

You cannot define an event's accessor functions in an interface. For more information, see Events and Interfaces.

The following sample generates CS0069:

// CS0069.cs  
// compile with: /target:library  
  
public delegate void EventHandler();  
  
public interface a  
{  
   event EventHandler Click { remove {} }   // CS0069  
   event EventHandler Click2;   // OK  
}