国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

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

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

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

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

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

GroupBox、TpsLabel、ListView和Microsoft PicureBox以及

圖中的DataGrid將自動(dòng)添加到中的控件集合

初始化組件。它可能看起來(lái)是這樣的:

this.Controls.Add(this.numPad1);

?如果上圖代表應(yīng)用程序的第一個(gè)視圖,則控件

的基類處理

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

由TAF調(diào)用。當(dāng)Dispose中的以下語(yǔ)句

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

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

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

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

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

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

?GUI控件沒(méi)有圖形表示,但位于

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

RapidDataBindingSource、AlphaPad等未添加到

默認(rèn)情況下控制集合。這些是你需要的

刪除時(shí)要特別小心,因?yàn)槔占饔肋h(yuǎn)不會(huì)收集它們。

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

永久性內(nèi)存泄漏。仔細(xì)研究下一節(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)閉時(shí)從第一個(gè)視圖調(diào)用其Dispose方法的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
凤翔县| 宁国市| 黄山市| 博乐市| 兴海县| 琼海市| 锡林浩特市| 黄浦区| 宁陕县| 祁连县| 瓦房店市| 昌都县| 寻乌县| 凤庆县| 晋中市| 信阳市| 阿克苏市| 武平县| 上蔡县| 靖西县| 秦皇岛市| 天峨县| 汪清县| 丰台区| 玉树县| 化隆| 云梦县| 宁夏| 黄山市| 吴堡县| 扎囊县| 洛南县| 仁布县| 襄垣县| 祁阳县| 奎屯市| 沙雅县| 梨树县| 郧西县| 庐江县| 云浮市|