Orderrring a List Ascending or Descending C# Advanced

Hey guys
I am wanting to create an array with class
this is my class

[System.Serializable]
public class Objects{
public String Name;
public float Value
}

and i have this variable

public Objects[] ObjectsList;

Now I need two function that orders the list

public enum order {ascending, descending}
public enum by {string, float}
public void Order (order Order, by By) {
// this function has to order ascending or descending by string or float.
// string = Name
// float = value
}

How can i do this? I have seen Array.Sort, but I am not sure, Can anyone help me please?
Thanks see you, byeeee!

This really isn’t anything Unity specific - if you want to know how to sort a list in C#, try googling it. There are many posts out there, for instance this one which appeared first in google for me:

You can use a delegate to specify how to sort. Like this:

Things[] thingArray = new Things[3];
public enum order {ascending, descending};
public enum byvar {bystring, byfloat};

	thingArray[0] = new Things("betty",1);
	thingArray[1] = new Things("catherine",2);
	thingArray[2] = new Things("abel",3);
	void mysort(order Order, byvar By) {
		if (Order == order.ascending) {
			if (By == byvar.bystring) {
				System.Array.Sort(thingArray, delegate(Things thing1, Things thing2) {
					return thing1.tname.CompareTo(thing2.tname);
				});
			}
			else if (By == byvar.byfloat) {			
				System.Array.Sort(thingArray, delegate(Things thing1, Things thing2) {
					return thing1.number.CompareTo(thing2.number);
				});
			}
		}
		else {
			if (By == byvar.bystring) {
				System.Array.Sort(thingArray, delegate(Things thing1, Things thing2) {
					return thing2.tname.CompareTo(thing1.tname);
				});
			}
			else if (By == byvar.byfloat) {			
				System.Array.Sort(thingArray, delegate(Things thing1, Things thing2) {
					return thing2.number.CompareTo(thing1.number);
				});
			}
		}
	}