编程语言

img redbb

about MSDN's dispose()

发表于2004/10/10 18:05:00  1406人阅读

分类: .net

Here is a Question about MSDN's dispose() : http://blog.mvpcn.net/cuike519/archive/2004/09/04/3579.aspx

about that dispose() method , I think it' s:

public class SimpleControl: System.Web.UI.Control
{
public override void Dispose()
{
base.Dispose ();
}
}
it has  no error 
but if you derive from  System.ComponentModel.Component ,it has two  Dispose() method
void Dispose()
void Dispose(bool disposing)

ms has approved it's msdn 's error .
only second can be overrided
so right is :

[c#]
public void Dispose();
protected virtual void Dispose(bool disposing);

[vb.net]
Public Sub Dispose()
Protected Overridable Sub Dispose(ByVal disposing As Boolean)

阅读全文
0 0

相关文章推荐

img
取 消
img