我有一个事件,实际上只是让用户知道发生了什么事。他们必须手动对该事件采取行动,因为没有数据从中传递。
但是,我不确定什么会更惯用:
public event Action MyEvent;
//clearly says no arguments
public event EventHandler MyEvent;
//uses the EventHandler class to no effect, but might be more idiomatic.
public event Action<object> MyEvent;
//just like the first but passes the sender if needed.
这将是执行此操作的标准方法?