sorting - C# Sort List Based on Another List -


I have a class that has multiple lists & lt;> exists in it basically a list A table stored as & lt;> does not include the same type in each column. Each list has the same length (the same number of elements).

For example:

I have 3 lists & lt;> objects; A list, two lists, and three lists.

  // The syntax is not the correct list & lt; DateTime & gt; A = new list ... {4/12/2010, 4/9/2006, 4/13/2008}; & Lt; Double & gt; Two = new list ... {24.5, 56.2, 47.4}; & Lt; String & gt; Three = new list ... {"b", "k", "z"};  

I want to be able to sort the most recent list from the oldest: a = {4/9/2006, 4/13/2008, 4/12/2010};

So to do this, I took element 0 to the end.

Then I want to sort the list of two and three types;

So when I sort a list, I want data in this index in other lists so that how a list can be solved.

I'm afraid that I have to surcharge to the iCompairer anyway, but I feel that I have not felt a shortcut.

I have managed this design in the past or by creating a separate index list. You can sort the index list first, and then use (or simply login) to sort other lists, you can do this by creating a custom iccomper for this indicator list. The icon that you put inside the composer is to compare in the key list based on the index. In other words, you are sorting the index list indirectly. Something like this:

  // This is a comparison function for a separate * index * list Compare Intel (object x, object y) {KeyList [(int) x]. Compilers (Callist [ (Int) y])}  

then you are sorting the index list on the base value in the main list then you can use that notified key list to redraw the other lists Can do for If this is not clear, then I will attempt to add another completely example when I post in a situation.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -