or will that be enough and the "bar" is located along with the "foo"?
No, the panel will not be removed.
Operator
using converted to a try-finally block, so even if an exception occurs, the finally block provides a call to the Dispose method.
After
using (SomeIdisposableImplementation foo = new SomeIdisposableImplementation()) { SomeIdisposableImplementation2 bar = new SomeIdisposableImplementation2(); }
Translated to
{ SomeIdisposableImplementation foo; try { foo = new SomeIdisposableImplementation(); SomeIdisposableImplementation2 bar = new SomeIdisposableImplementation2(); } finally { if (foo != null) foo.Dispose(); } }
Leave bar inactive.
Habib source share