In the IDisposable.Dispose method is there a way to figure out if an exception is being thrown?
IDisposable.Dispose
using (MyWrapper wrapper = new MyWrapper()) {
Instead of the syntactic sugar of the using statement, why not just implement your own logic for this. Something like:
try { MyWrapper wrapper = new MyWrapper(); } catch (Exception e) { wrapper.CaughtException = true; } finally { if (wrapper != null) { wrapper.Dispose(); } }