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 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
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.