Why can't I put a delegate in an interface?

前端 未结 7 1020
清歌不尽
清歌不尽 2021-02-01 03:24

Why can\'t I add a delegate to my interface?

7条回答
  •  后悔当初
    2021-02-01 04:22

    A Delegate is just another type, so you don't gain anything by putting it inside the interface.

    You shouldn't need to create your own delegates. Most of the time you should just use EventHandler, Func, Predicate, or Action.

    May I ask what your delegate looks like?

提交回复
热议问题