What’s in Your Collection? Part 2 of 3: Concrete

The collection is a powerful construct that allows a developer to logically group related elements and navigate through them. In this article, we’ll explore some concrete implementations of collections that are part of the base .NET framework. The entire series can be accessed here: Part 1: Interfaces Part 2: Concrete Part 3: Custom Collections (If…

Editing WPF Controls in Expression Blend

This is one of those quirks that until you try it, you may not know it exists or what the answer is. I am working on a WPF project and have a separate control library (actually, a module because I am using the Component Application Guidance/PRISM pattern). I pulled it into Expression Blend and was…

Ref Keyword for Reference Types

The Ref keyword is well known. It indicates that you are passing a reference, not a value, to a method. That means that if the method modifies the value, the changes will be apparent to the calling method as well. Where I see a lot of confusion, however, is what happens when dealing with reference…

Pragmatic Reflection on Singletons

So today I was wading through some code that gets called quite a bit. It is in a process that might be hit thousands of times per second. It uses a pipeline pattern so there are several objects to “new up” and place in the pipeline. Being performance-minded I originally was tempted to follow the…

Lambda Expressions, Anonymous Methods, and Syntactic Sugar

What is the relationship between lambda expressions, anonymous methods, and delegates? The answer is, in two words: syntactic sugar … or is it? To show this, I put together a real simple console program that declares a delegate which returns a string. I then declare a concrete method that matches the delegate signature, and another…

Silverlight Captcha Example

Silverlight, with its powerful text and graphics manipulation capabilities and strong interaction with the scripting DOM, seems to be the perfect engine for a Captcha challenge. See an Example Online Download the Source (18.3KB) Captcha is a challenge-response test used to determine to a degree of confidence that the end user is really human and…

Windows Workflow Sequential Workflow Unit Testing

Windows Workflow Foundation (WWF) is a powerful programming model and designer for workflow processes. Using workflow is easier than some may believe. I wanted to share a quick post relative to some practices I’ve found useful for sequential workflows, specifically around Inversion of Control (IoC) and unit testing. In our shop we have several complex…