It should get disposed as indicated in the C# spec.
http://msdn.microsoft.com/library/de...pspec_8_13.asp
The following code...
using (OpenFileDialog dlg = new OpenFileDialog())
{
//do something
}
....should get expanded to something like this...
OpenFileDialog dlg = new OpenFileDialog();
try
{
//do something
}
finally
{
if (dlg != null)
{
((IDisposable)dlg).Dispose();
}
}
--
Tim Wilson
..Net Compact Framework MVP
"Austin Jan" <au********@gmail.com> wrote in message
news:Op**************@TK2MSFTNGP09.phx.gbl...
Hi all,
In this code snip
try
{
using(OpenFileDialog dlg = new OpenFileDialog())
{
//do something
}
}
catch
{
//do someting
}
if CLR throw FileOntFoundException in try block, Will dlg call
dlg.Dispose() finally?
thanks.