thanx man, thats an elegant way to do it which I will use from now on :)

Jaroslaw Kowalski wrote:
Ok, but how does an exception fit in? You need to know if there was an error to log it or do additional stuff (like MsgBox.Show etc.).


How about this:

try
{
   using (resource)
   {
   }
}
catch (Exception ex)
{
   // resource already freed
}

or

using (resource)
{
   try
   {
   }
   catch (Exception ex)
   {
       // can still access resource here
   }
}

--
Emil R. Emilov
-----------------------------------------------------------------------
mailto:[EMAIL PROTECTED]
http://www.emilov.de
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to