示例#1
0
 public static ICommonType GetCommonType(this IHasTypes hasTypes, string typeFullName, bool throwExceptionIfNotFound = false)
 {
     return((hasTypes.TypeFullNameToTypes.TryGetValue(typeFullName, out var commonTypes) ? commonTypes : Enumerable.Empty <ICommonType>()).SingleOrDefault(throwExceptionIfNotFound, typeFullName));
 }
示例#2
0
 public static IEnumerable <ICommonType> GetInheritanceCommonTypes(this IHasTypes hasTypes, IHasType hasType)
 {
     return(hasTypes.GetInheritanceCommonTypes(hasType.Type));
 }
示例#3
0
 public static bool TryGetCommonType(this IHasTypes hasTypes, string typeFullName, out ICommonType foundCommonType)
 {
     return((foundCommonType = hasTypes.GetCommonType(typeFullName)) != null);
 }
示例#4
0
 public static IEnumerable <ICommonType> GetInheritanceCommonTypes(this IHasTypes hasTypes, Type baseType)
 {
     return(hasTypes.Types.Where(type => type.IsInheritedFrom(baseType)));
 }