How can I order PropertyInfos? I have a class:
public class Test
{
public int Number { get; set; }
public string Text { get; set; }
public bool IsActive { get; set; }
public File File { get; set; }
}
And I get the properties using typeof(Test).GetProperties();
How can I order them by type? Example:
typeof(Test).GetProperties().OrderBy(new List<Type>()
{
typeof(File),
typeof(string),
typeof(int),
typeof(bool)
});
So result will be :
File, Text, Number, IsActive
If there was a different list of hints, the result should also be changed.
Can it be done?