Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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 (C# Programming Guide) and Interfaces (C# Programming Guide).
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
}