Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Generic Multi-Field/Property Sorting for Lists of Business Objects

, 13 Feb 2008 CPOL
This article presents a simple and flexible way to sort strongly-typed lists of business objects using multiple properties or fields.
multisortsourceanddemo.zip
MultiSortLib
bin
Debug
MultiSortLib.dll
Release
MultiSortLib.instr.pdb
Properties
HyperPropertyDescriptor
HyperPropertyDescriptor
bin
Release
HyperPropertyDescriptor.csproj.user
Properties
HyperPropertyDescriptorSample
bin
Release
HyperPropertyDescriptor.dll
HyperPropertyDescriptor.pdb
HyperPropertyDescriptorSample.exe
HyperPropertyDescriptorSample.pdb
HyperPropertyDescriptorSample.csproj.user
Properties
MultiSortDemo
bin
Debug
MultiSortDemo.exe
MultiSortDemo.vshost.exe
MultiSortLib.dll
Release
MultiSortDemo.instr.pdb
MultiSortDemo.vshost.exe
MultiSortLib.instr.pdb
Properties
DataSources
WorkItem.datasource
WorkItemPropertyName.datasource
Settings.settings
Direct access
MyEntity.Name	GetValue	8ms
MyEntity.Name	SetValue	97ms
MyEntity.Name	ValueChanged	1022ms
OpCount: 25000000

Without HyperTypeDescriptionProvider
MyEntity.Name	GetProperties	647ms
MyEntity.Name	IsReadOnly	2926ms
MyEntity.Name	SupportsChangeEvents	245ms
MyEntity.Name	GetValue	10360ms
MyEntity.Name	SetValue	20288ms
MyEntity.Name	ValueChanged	29566ms
OpCount: 25000000
MySuperEntity.Name	GetProperties	828ms
MySuperEntity.Name	IsReadOnly	2881ms
MySuperEntity.Name	SupportsChangeEvents	241ms
MySuperEntity.Name	GetValue	10682ms
MySuperEntity.Name	SetValue	20730ms
MySuperEntity.Name	ValueChanged	30979ms
OpCount: 25000000
MySuperEntity.When	GetProperties	825ms
MySuperEntity.When	IsReadOnly	2888ms
MySuperEntity.When	SupportsChangeEvents	251ms
MySuperEntity.When	GetValue	11393ms
MySuperEntity.When	SetValue	22416ms
OpCount: 10000000

With HyperTypeDescriptionProvider
MyEntity.Name	GetProperties	699ms
MyEntity.Name	IsReadOnly	43ms
MyEntity.Name	SupportsChangeEvents	41ms
MyEntity.Name	GetValue	57ms
MyEntity.Name	SetValue	155ms
MyEntity.Name	ValueChanged	954ms
OpCount: 25000000
MySuperEntity.Name	GetProperties	914ms
MySuperEntity.Name	IsReadOnly	41ms
MySuperEntity.Name	SupportsChangeEvents	44ms
MySuperEntity.Name	GetValue	95ms
MySuperEntity.Name	SetValue	173ms
MySuperEntity.Name	ValueChanged	1059ms
OpCount: 25000000
MySuperEntity.When	GetProperties	891ms
MySuperEntity.When	IsReadOnly	41ms
MySuperEntity.When	SupportsChangeEvents	46ms
MySuperEntity.When	GetValue	295ms
MySuperEntity.When	SetValue	110ms
OpCount: 10000000

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

owen654321
Software Developer (Senior) Troppus Software
United States United States
Currently working as a Senior Silverlight Developer with Troppus Software in Superior, CO. I enjoy statistics, programming, new technology, playing the cello, and reading codeproject articles. Smile | :)

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.1411023.1 | Last Updated 13 Feb 2008
Article Copyright 2007 by owen654321
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid