Using IDisposable to unsubscribe events

前端 未结 9 2077
广开言路
广开言路 2020-11-28 05:52

I have a class that handles events from a WinForms control. Based on what the user is doing, I am deferencing one instance of the class and creating a new one to handle the

9条回答
  •  有刺的猬
    2020-11-28 06:36

    IDisposable is firmly about resources, and the source of enough problems to not muddy the waters further I think.

    I'm voting for an Unsubscribe method on your own Interface too.

提交回复
热议问题