I have a BindingList with objects in which is saved some contacts.
internal static BindingList<object> contactList;
The contactList object is more types. SktContact, FBContact, GContact.
These contacts I add in contactList_Changed event to listBox. But I want sort them by status (first online) and then alphabetically.
I would like somethink like this:
List<object> contactSorted = new List<object>();
contactSorted = Global.contactList.ToList();
contactSorted.OrderBy((status, name) => Converter.getContactAvailabilityStatus(contactSorted[?]), Converter.getContactName(contactSorted[?]));
contactListBox.Items.AddRange(contactSorted.ToArray());
But I dont have any idea how shoud I do that. I cannot retype the list of objects and select the property to order by.
I have methods to get status and name from any object. But how can I use it to sort the contact array?
I'm using own drawing Owner draw fixed
private void contactListBox_DrawItem(object sender, DrawItemEventArgs e)