public static IEnumerableEnumerateReturnTypeProperties() { Type type = typeof(TargetClass); PropertyInfo[] props = type.GetProperties(); foreach (PropertyInfo prop in props) { // null as 1st GetValue parameter implies // only static properties enumerated ReturnType xxx = prop.GetValue(null, null) as ReturnType; if (xxx == null) continue; yield return xxx; } }
No comments:
Post a Comment