五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

ABB DSQC679 3HAC028357-001 關(guān)閉時從第一個視圖調(diào)用其Dispose方法

2023-03-31 09:28 作者:文武雙全何15859219118  | 我要投稿

學習并應用這些GUI控件內(nèi)存管理的一般規(guī)則。

?具有圖形表示的控件,例如ABB Numpad、TabControl、,

GroupBox、TpsLabel、ListView和Microsoft PicureBox以及

圖中的DataGrid將自動添加到中的控件集合

初始化組件。它可能看起來是這樣的:

this.Controls.Add(this.numPad1);

?如果上圖代表應用程序的第一個視圖,則控件

的基類處理

當應用程序關(guān)閉并且Dispose方法為

由TAF調(diào)用。當Dispose中的以下語句

方法被執(zhí)行:base.Dispose(Dispose);

?但是,如果它代表應用程序的輔助視圖(即

實際上是這種情況,從命令上的關(guān)閉按鈕可以看出

bar),則必須在其關(guān)閉時從第一個視圖調(diào)用其Dispose方法。

然后,它的基類將刪除作為其控件一部分的所有控件

集合,就像前面的情況一樣。

?GUI控件沒有圖形表示,但位于

表單下的組件窗格,例如GTPUSaveFileDialog,

RapidDataBindingSource、AlphaPad等未添加到

默認情況下控制集合。這些是你需要的

刪除時要特別小心,因為垃圾收集器永遠不會收集它們。

如果您忘記對此類控件顯式調(diào)用Dispose,您將導致

永久性內(nèi)存泄漏。仔細研究下一節(jié)中的代碼示例

部分

Learn and apply these the general rules for memory management of GUI controls.

? Controls with a graphical representation, e.g the ABB Numpad, TabControl,

GroupBox, TpsLabel, ListView and the Microsoft PicureBox and

DataGrid in the figure, are automatically added to the controls collection in

InitializeComponent. It may look like this:

this.Controls.Add(this.numPad1);

? If the preceding figure represents the first view of your application, controls

with graphical representation will be disposed of by the base class of your

view class when your application is shut down and the Dispose method is

called by TAF. This happens when the following statement in your Dispose

method is executed: base.Dispose(disposing);

? If, however, it represents a secondary view of your application (which is

actually the case here, as you can tell from the close button on the command

bar), you must call its Dispose method from the first view when it is closed.

Its base class will then remove all controls that are part of its controls

collection, like in the previous case.

? GUI controls that have no graphical representation, but are located in the

Components pane under the form, for example GTPUSaveFileDialog,

RapidDataBindingSource, AlphaPad and so on are NOT added to the

controls collection by default. These are the ones that you need to be

especially careful to remove, as no garbage collector will ever gather them.

If you forget to explicitly call Dispose on such controls you will have caused

a permanent memory leak. Carefully study the code example in the next

section.


ABB DSQC679 3HAC028357-001 關(guān)閉時從第一個視圖調(diào)用其Dispose方法的評論 (共 條)

分享到微博請遵守國家法律
且末县| 甘肃省| 丹凤县| 定远县| 广丰县| 普安县| 马尔康县| 什邡市| 西充县| 中山市| 社旗县| 广德县| 奈曼旗| 涡阳县| 襄垣县| 马尔康县| 辛集市| 长宁县| 滕州市| 抚顺县| 永寿县| 陆川县| 友谊县| 革吉县| 罗江县| 和田市| 兴国县| 民丰县| 行唐县| 焦作市| 格尔木市| 永泰县| 曲阜市| 九龙城区| 东兴市| 博客| 连城县| 黑水县| 东城区| 沛县| 湖南省|