Monthly Archives: August 2008

C# var keyword

I’m working my way through the C# 3.0 Language Enhancements videos on LearnVisualStudio.Net.  (Note:  LearnVisualStudio has many videos that are available for free from the MSDN website, but I think that you need a paid subscription to view this series.)  When I’m studying new programming concepts, I find that hearing someone talk about it helps me […]

C# “as” and “is” keywords

“Is” is exactly what I have been looking for.  You use it to check the type of an object.  For example: if(a is long) Gabe Wishnie points out that “is” is much more efficient than: if( a.GetType() == typeof(long)) “As” is a method of performing a typecast that gives you a null pointer rather than […]

.Net BackgroundWorker class

The BackgroundWorker class is an easy way to start up a thread from the GUI to run some lengthy action in the background.  Key points are: The DoWork event runs on the background thread.  You can’t interact with the GUI from there.  The ProgessChanged and RunWorkerCompleted events are raised by the background thread into the […]