November 19th, 2008

Multi-tasking / multi-threaded applications have always been a bit of a nightmare to create. Different operating systems and sometimes even different compilers and class libraries tends to have their own implementations. Fortunately the .NET / C# implementation of threading is extremely straightforward and makes it simple to create a multi threaded application. In this article we look at building some very simple threaded applications. We go into how to create them, synchronize them and how we can ensure that things such as shared variables are properly protected.
Read the rest of this entry »
Tags: c-sharp, Learn C#, multi threading, Thread
Posted in Intermediate, Learn C# | No Comments, yet!
November 18th, 2008
What is a delegate and why would you want to use them?
Calling methods with parameters comes natural in programming, but what if you would like to pass the methods themselves to another method?
To give an example: You might want to set a timer and have the timer call a particular method when the time comes. To avoid having to hard code each possible action together with its own timer you might want to pass the action method in your call to the timer itself. In C# this is called delegation.
Read the rest of this entry »
Tags: c-sharp, delegate, delegation, Learn C#
Posted in Beginner, Learn C# | 1 Comment already!»