public static IEnumerable <Member> GetREDBuffers(this CVariable cvar) { Type type = cvar.GetType(); Dictionary <Type, int> lookup = new Dictionary <Type, int>(); int count = 0; lookup[type] = count++; Type parent = type.BaseType; while (parent != null) { lookup[parent] = count; count++; parent = parent.BaseType; } return(cvar.GetREDBuffersInternal() .OrderByDescending(prop => lookup[prop.GetMemberInfo().DeclaringType])); }