I have a collection of Layers where they have names and colors. What I want to do is to sort these first based on colors, then based on their names:
Layers
Start by implementing the IComparable interface in Layer and declaring a CompareTo method. Then use a SortedList collection to store your object.
public class Layer : IComparable { public int CompareTo(object obj) { //return -1 if this is before obj, 0 is same, 1 is after. } }