Equivalent of VB's custom RaiseEvent blocks in C#?

前端 未结 4 404
陌清茗
陌清茗 2020-12-16 15:11

(I know the title sounds easy, but hold on—this probably isn\'t the question you think it is.)

In VB.NET I was able to write custom events. For an example, I

4条回答
  •  醉梦人生
    2020-12-16 16:01

    You simply can't. But since events can be raised only from inside the type that declares them, you can create a helper method that executes your specific raising code. And then just make sure you don't raise the event directly outside that method.

提交回复
热议问题