Jul
11th | 2008

List.Sort(), Comparer and IComparable

Posted by Amit |
Filed under C# |

Hi

In my previous article I talked about why SortedList is not a good option to use if you need a sorted collection with keys that are not unique. Today I will show you how to use a regular generic List<T> to store sorted items. You basically have 2 options.

IComparable Interface

this means that you will have to make your stored class Implement the IComparable Interface. Here is an example:


Continue Reading...
Jan
8th | 2008

How to Implement a Generic State Machine

Posted by Amit |
Filed under .Net, C#, Visual Studio |

Hi all.
In the course of my work i was in the need of a State Machine. i decided to implement a Generic version of the State Machine so I can reuse it if i will need it again. i started with defining the needs of a basic state and i can up with the [...]


Continue Reading...

Search Dev102