© { JSL }
80
using Statements
·
after discussions on the .NET reflector
w
M'Soft provided a solution consisting of...
w
the IDisposable
interface
in combination with...
w
the
using
statement
using
(
type variable
=
init)
embedded
-
statement
{
type variable
=
init
;
try
{
embedded
-
statement
}
finally
{
if
(
variable
!=
null
) {
((IDisposable)
variable
).Dispose();
}
}
}
precisely equivalent to