Getting creative with IDisposable Part 2


In my last post, I gave some examples of how we can use the IDisposable interface in conjunction with the using statement to implement an on/off pattern wrapping around some critical region of code, even though there is no “disposable resource” involved. Problems with using IDisposable In this post I want to expand on the … Continue reading Getting creative with IDisposable Part 2

Advertisements

Getting creative with IDisposable Part 1


It occurred to me it might be interesting to describe some of the more unconventional uses of IDisposable that can help to make your code more readable, and even apply a kind of AOP-style coding to your code. MSDN describes IDisposable as follows: - Defines a method to release allocated resources. In the remarks section … Continue reading Getting creative with IDisposable Part 1