How to Implement IDisposable (the easy way)

by Chad 2. April 2012 07:48

For my friends in the Springfield .NET Users group. You can use this C# code snippet to quickly implement the Dispose pattern in your classes. Enjoy!

How to install the snippet

Drop this .snippet file in your C:\Users\<UserName>\Documents\Visual Studio 2010\Code Snippets\Visual C#\My Code Snippets folder.

How to use this snippet

 

  1. Add the IDisposable interface to your class
  2. With the cursor inside your class declaration type: dispimp + tab + tab

 

Download the Snippet

dispimp.snippet (1.50 kb)

Resources

http://msdn.microsoft.com/en-us/library/system.idisposable.aspx

Tags:

.NET-Basics

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Chad

Meeeee!!!

Hi, my name is Chad Boschert and I'm a software developer in Springfield, Missouri. I've been developing .NET applications in C# since 2002.

Recent Comments

Comment RSS

Calendar

<<  June 2013  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar