在用户控件实现Dispose(布尔) [英] Implement Dispose(bool) on a UserControl
问题描述
如何在用户控件执行的Dispose(布尔)......当VS设计已经实现了它与 DebuggerNonUser code 属性?请问我的修改,这种方法去除?
($ C $从UserControl.Designer.vb C)
< System.Diagnostics.DebuggerNonUser code()> _
受保护的覆盖子的Dispose(BYVAL处置作为布尔)
您需要从设计器文件中删除处置
方法,并将其添加到您的源文件。< BR>
你或许应该也删除 DebuggerNonUser code
属性。
至少在C#中,设计师将不会自动把处置
返回到设计文件,如果VB的设计师做了我会感到震惊。
How to implement the Dispose(boolean) at a UserControl... when the VS Designer already implemented it with a DebuggerNonUserCode attribute? Will my modifications on this method removed?
(code from UserControl.Designer.vb)
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
You need to remove the Dispose
method from the designer file and add it to your source file.
You should probably also remove the DebuggerNonUserCode
attribute.
At least in C#, the designer will not automatically put the Dispose
back into the designer file, and I'd be shocked if the VB designer did.
这篇关于在用户控件实现Dispose(布尔)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!