better version for deep search props also in basetypes
public static IEnumerable GetAllProperties(Type t)
{
if (t == null)
return Enumerable.Empty();
BindingFlags flags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly;
return t.GetProperties(flags).Union(GetAllProperties(t.BaseType));
}