IDisposable Part 5 – Using IDisposable Classes in C#

For part 5 of my series on IDisposable, I want to focus on using IDisposable objects.  We’ve seen many of the ways and reasons you might create an IDisposable class.  Now, we’ll use the classes we’ve created.

Read more

IDisposable Part 4 – Factored Types

For part 4 of my series on IDisposable, I wanted to mention one other place where this interface should be used – Factored Types.

Read more

IDisposable Part 3 – Encapsulating an IDisposable class

For part 3 of my series on IDisposable, I’m going to focus on ownership of other IDisposable resources.  In this series, we’re going to build on our LicenseAGenerator class from Part 2, encapsulating inside of a class which will use it repeatedly.

Read more

IDisposable Part 2 – Subclass from an IDisposable class

For part 2 of my series on IDisposable, I’m going to focus on subclassing from our IDisposable resource.  We will build on our LicenseGenerator class from Part 1, extending it with some additional functionality.

When subclassing from an IDisposable resource, there are two possibilities for requirements in handling IDisposable correctly.  If we are not introducing any other unmanaged or managed resources that need to be disposed, we can handle this very simply.

Read more

IDisposable Part 1 – Releasing Unmanaged Resources

IDisposable, what is it, why is it needed?  In this part of our series on IDisposable, we’re going to focus on the initial, and primary use case of IDisposable – wrapping unmanaged resources…

Read more