コード例 #1
0
 public static bool IsDacField(this ITypeSymbol typeSymbol)
 {
     if (!typeSymbol.BaseValidation())
     {
         return(false);
     }
     else if (typeSymbol.ImplementsInterface(TypeNames.IBqlField))                   //Should work for named types and type parameters in most cases
     {
         return(true);
     }
     else if (typeSymbol is ITypeParameterSymbol typeParameterSymbol)                //fallback for type parameters when Roslyn can't correctly determine interfaces (see ATR-376)
     {
         return(typeParameterSymbol.GetAllConstraintTypes()
                .Any(constraint => constraint.ImplementsInterface(TypeNames.IBqlField)));
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
 public static bool IsDacExtension(this ITypeSymbol typeSymbol) =>
 typeSymbol.BaseValidation()
                         ? typeSymbol.InheritsOrImplementsOrEquals(TypeNames.PXCacheExtension, includeInterfaces: false)
                         : false;