public static IEnumerable <Type> AllInterfaces(this Type target) { foreach (var IF in target.GetInterfaces()) { yield return(IF); foreach (var childIF in IF.AllInterfaces()) { yield return(childIF); } } }
public static IEnumerable <Type> AllInterfaces(this Type target) { Type[] interfaces = target.GetInterfaces(); foreach (Type IF in interfaces) { yield return(IF); foreach (Type item in IF.AllInterfaces()) { yield return(item); } } }