Home     About PeterBlum.com     Policies     Download a Licensed Product     Newsletter
AutoSortArrayList Class  
Current Release: 1.0.0  

AutoSortArrayList fills a gap in the various collection classes offered within the Microsoft.NET framework. It maintains a list that is always sorted. The list does not use a key to identify each instance.
The .NET framework offers similar classes, each with shortcomings.
  • ArrayList - Can sort any type of object but cannot automatically add instances into the correct sorted position.
  • SortedList - Can keep any type of object in a sorted order. However, it demands a key for every instance. If you don't manage your objects by name, this won't work.
  • StringCollection - Can keep a list of strings without the requirement of a key. However, it can't keep them sorted.
AutoSortArrayList extends ArrayList by overriding methods that add, to automatically place objects in the correct position. You can turn on and off this auto sort functionality with a property.

It can sort any type of object, so long as that class implements the IComparable interface or you have a Comparer object. AutoSortArrayList has a property to assign your Comparer object. For instance, if you want to use AutoSortArrayList for strings, assign System.Collections.CaseInsensitiveComparer.


Product AutoSortArrayList
Version 1.0 (Current release: 1.0.0)
Price Free
Restricted Usage Unrestricted. A donation to the .Net development community. However, it is distributed "AS IS".
Source Code Included
Language C#
Compatibility Microsoft .Net 1.0 and 1.1
Installation You will download a Zip file named CollectionsLibrary.zip. Extract its contents. It will place all files into a folder named CollectionsLibrary.
Documentation Once installed, open the source code file CollectionsLibrary.cs. It is heavily documented. You can include this file into your C# projects directly. If you use another language, create a C# project to contain it.

Download this file