Geeklog
There's no place like 127.0.0.1 - ramblings about programming

Silverlight DataTemplateSelector

September 11, 2009 19:03 by The Geek
You may or may not be aware that WPF supports System.Windows.Controls.DataTemplateSelectors.  As the documentation says, this class provides a way to choose a DataTemplate based on the object that it is bound to.  This is really useful behaviour, even though it may not be a daily task.&nbs... [More]

Another LINQ Test

September 7, 2009 18:23 by The Geek
Yes, this has been discussed quite a bit but I wanted to do a quick test on LINQ code performance. More...

Coding Style (The Law)

September 3, 2009 18:29 by The Geek
There are loads of arguments on the web about how you should style your code.  These are my preferences, you can think of them as the law . Use StyleCop.  This is an absolute no-brainer.  If you live in the Microsoft world, then you should use this.  Yes, it is onl... [More]

Warning About Warnings

July 7, 2009 19:28 by The Geek
Saw this a couple of minutes ago... "Professionals treat all warnings as errors. Amateurs ignore warnings. Idiots suppress warnings." It's brilliant!  It was posted by JD on TDWTF.
Tags: ,
Categories: C#
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Have You Joined The Dark Side?

November 26, 2008 18:58 by The Geek
I've been really busy with work recently - so lots of things to post about and no time to post! Well there is something really important ;-) In case you didn't know, you can apply themes to Visual Studio - well the best one is available here: The Dark Side  (instructions a... [More]

Creating a MD5 or SHA hash in C#

August 18, 2008 11:15 by The Geek
Something that comes up every once in a while is the need to create a hash in C# [code:c#] private string CreateMD5(string input) {     MD5 md5 = new MD5CryptoServiceProvider();     byte[] data = Encoding.ASCII.GetBytes(input);     ... [More]
Tags: , ,
Categories: C#
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Advanced Object Builder - Dependency Injection

April 17, 2008 16:30 by The Geek
This a continuation from here, here, here, here and here. The final feature of my object builder is dependency injection. Dependency injection is useful as the class that has the dependency does not need to know about how to obtain an instance.  This is handy is many situations - ... [More]

Advanced Object Builder - Singleton Policy

April 17, 2008 14:30 by The Geek
This a continuation from here, here, here and here. The singleton pattern can be very useful in many situations.  In this post I will describe how we can add a simple implementation to our object builder. The first thing we need is a way of determining which classes should be trea... [More]
Tags: ,
Categories: C#
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Advanced Object Builder - Type Substitution

April 17, 2008 12:48 by The Geek
This a continuation from here, here and here. So far, the object builder can create instances using either constructors or factory methods.  It can also access custom configuration sections.  Now I am going to show how we can extend it to provide type substitution.  Please not... [More]

Advanced Object Builder - Factory Methods

April 17, 2008 09:40 by The Geek
This a continuation from here and here. I am going to write about how we can extend our object builder to include support for factory methods.  Now that we have custom config sections, it becomes easy to add this feature.  As factory methods are used for the creation of instan... [More]