Exemple #1
0
 private static IEnumerable <Type> TypesAssignableFrom(Type candidateType)
 {
     return(candidateType.GetTypeInfo().ImplementedInterfaces.Concat(
                Traverse.Across(candidateType, t => t.GetTypeInfo().BaseType)));
 }
Exemple #2
0
 static IEnumerable <Type> TypesAssignableFrom(Type candidateType)
 {
     return(candidateType.GetInterfaces().Concat(
                Traverse.Across(candidateType, t => t.BaseType)));
 }
Exemple #3
0
 private static bool ParameterCompatibleWithTypeConstraint(Type parameter, Type constraint)
 {
     return(constraint.IsAssignableFrom(parameter) || Traverse.Across <Type>(parameter, p => p.BaseType).Concat <Type>(parameter.GetInterfaces()).Any <Type>(p => p.GUID.Equals(constraint.GUID)));
 }