My new favorite macro in Visual Studio 2008 is control-D then control-K. Hit that key sequence and voila: all code on the page has been formatted. It’s especially helpful when copy-pasting. Just a tip from Tim to make your life easier!
Continue reading about Auto Format Code in Visual Studio 2008
The IsNullOrEmpty method was added to the String class in the 2.0 Framework, and it makes testing for an empty or null string as easy as a single function call. Instead of having to test the String object if it’s null then checking if it’s empty, this can now be done in one easy method [...]
I recently completed a project at work that included the requirement to monitor data files on 30 or more different Windows NT4 machines for changes. Naturally I thought of using the FileSystemWatcher class in the System.IO namespace. As anyone who has used the FileSystemWatcher has come to realize, it can be unreliable. Specifically, if one [...]
In the first part of my series on Generics in VB.NET I discussed the advantages of generic collections. In this installment I’ll cover the Nullable Generic Structure.
First, let’s cover some background. A type is nullable if it can be assigned a value or Nothing (null in C#). For example a String object is nullable because [...]
Continue reading about A Case for Generics in VB.NET – Part 2
Dim, ReDim, ReDim Preseve, Repeat. Sound familiar? If so, maybe you want to look into generic collections. In the System.Collections namespace the ArrayList class will give you a dynamically allocated list of objects that’s easy to use. You won’t need to worry about ReDim’ing the array if you need to add items, and you won’t have [...]
Continue reading about A Case For Generics In VB.NET – Part 1