Menu.Dispose(Boolean) 方法

定义

处置由 Menu 占用的资源(内存除外)。Disposes of the resources, other than memory, used by the Menu.

protected:
 override void Dispose(bool disposing);
protected override void Dispose (bool disposing);
override this.Dispose : bool -> unit
Protected Overrides Sub Dispose (disposing As Boolean)

参数

disposing
Boolean

true 表示释放托管资源和非托管资源;false 表示仅释放非托管资源。true to release both managed and unmanaged resources; false to release only unmanaged resources.

注解

在完成使用 Dispose 后,应调用 MenuCall Dispose when you are finished using the Menu. Dispose 方法使 Menu 处于不可用状态。The Dispose method leaves the Menu in an unusable state. 调用Dispose后,必须释放对的Menu所有引用,以使其占用的内存可通过垃圾回收进行回收。After calling Dispose, you must release all references to the Menu so the memory it was occupying can be reclaimed by garbage collection.

备注

每次释放对 Dispose 的最后一个引用前,均应调用 MenuAlways call Dispose before you release your last reference to the Menu. 否则,在垃圾回收Menu Menu调用对象的析构函数之前,将不会释放正在使用的资源。Otherwise, the resources the Menu is using will not be freed until garbage collection calls the Menu object's destructor.

适用于