¡@

Home 

c# Programming Glossary: mycomparer

Sorting an IList in C#

http://stackoverflow.com/questions/15486/sorting-an-ilist-in-c-sharp

in. I ended up using the ArrayList.Adapter list .Sort new MyComparer method to solve the problem but it just seemed a bit ghetto..

Sorting an array of folder names like Windows Explorer (Numerically and Alphabetically) - VB.NET

http://stackoverflow.com/questions/3099581/sorting-an-array-of-folder-names-like-windows-explorer-numerically-and-alphabet

strings as numbers so that 1 sorts before 10. public class MyComparer IComparer string DllImport shlwapi.dll CharSet CharSet.Unicode.. y return StrCmpLogicalW x y Array.Sort unsortedNames new MyComparer And since I just noticed the question is tagged VB... Forgive.. question is tagged VB... Forgive my rusty VB Public Class MyComparer Implements IComparer Of String Declare Unicode Function StrCmpLogicalW..

Linq Distinct() use delegate for equality comparer

http://stackoverflow.com/questions/4607485/linq-distinct-use-delegate-for-equality-comparer

statement that uses my own custom comparer like this class MyComparer T IEqualityComparer T where T MyType public bool Equals T x.. ... var distincts bundle.GetAllThings.Distinct new MyComparer MySubType This is all fine and dandy and works as I want. Out..

Use own IComparer<T> with Linq OrderBy

http://stackoverflow.com/questions/985657/use-own-icomparert-with-linq-orderby

own IComparer T with this. It looks like this public class MyComparer IComparer Object public int Compare Object stringA Object stringB.. to use this IComparer case ListSortDirection.Ascending MyComparer comparer new MyComparer items items.OrderByDescending x property.GetValue.. case ListSortDirection.Ascending MyComparer comparer new MyComparer items items.OrderByDescending x property.GetValue x comparer..