什么是静态的事件处理程序和非静态事件处理程序的区别 [英] what's the difference between static event handler and non-static event handler

查看:227
本文介绍了什么是静态的事件处理程序和非静态事件处理程序的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有这两个之间的差别那么大?

Is there big difference between those two?

推荐答案

语义上没有区别,但使用静态的事件处理程序(如果你不小心)会导致内存泄漏。见这篇文章获取更多信息。

Semantically there are no differences, however using static event handlers can (if you're not careful) lead to memory leaks. See this article for more info.

我已经遇到这个问题我自己,试图用一个静态的事件处理程序,以保持应用程序范围内的数据源是最新的;事件处理程序是$ P $的布置pventing我的的BindingSource 的组件,从而导致各种奇怪的问题...

I've come across this problem myself, trying to use a static event handler to keep an application-wide data source up to date; the event handler was preventing my BindingSource components from being disposed, leading to all sorts of weird problems...

这篇关于什么是静态的事件处理程序和非静态事件处理程序的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆