Click here to Skip to main content
11,630,144 members (77,941 online)
Click here to Skip to main content
Add your own
alternative version

MultiList: .NET Generic List with Multiple Sort Orders

, 1 Feb 2008 CPOL 28.6K 148 16
The MultiList class extends the functionality of the generic list. The MultiList class manages multiple sort orders on lists. It is best suited to object lists where searching is required on more than one criteria.
multilist.zip
AsAbove
Collections
MultiList
MultiList
bin
Release
AsAbove.Collections.MultiList.dll
Documentation
Help
MultiList.chm
Properties
Source
AsAbove
Collections
Test
bin
Release
AsAbove.Collections.MultiList.dll
Test.dll
Properties
// 
// MultiList library - Copyright 2008 by Michael Moorman / AsAbove.net
// This work is released to the public domain, and may be used for any purpose, without any conditions.
// 
using System;
using System.Collections.Generic;
using System.Text;

namespace Test
{
	public class Person : System.IEquatable<Person>
	{
		public enum Profession
		{
			Teacher,
			Nurse,
			Barber,
			Welder,
			Carpenter,
			Lawyer
		};

		private string _name;
		private int _age;
		private Profession _career;
		private static int _static_sequence = 0;
		private int _sequence;

		public Person (string name, int age, Profession career)
		{
			_name = name;
			_age = age;
			_career = career;
			lock (typeof (Person))
			{	
				_sequence = ++_static_sequence;
			}
		}

		public string Name
		{
			get { return _name; }
		}

		public int Age
		{
			get { return _age; }
		}

		public Profession Career
		{
			get { return _career; }
		}

		public int Sequence
		{
			get { return _sequence; }
		}

		public bool Equals (Person p)
		{
			return Sequence == p.Sequence;
		}

	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

gogglin
United States United States
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150723.1 | Last Updated 2 Feb 2008
Article Copyright 2008 by gogglin
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid