Esempio n. 1
0
 public bool IsTypeMatched(Type type)
 {
     if (TargetTypes == null)
     {
         return(false);
     }
     if (IncludeInherited)
     {
         return(TargetTypes.Any(target => type == target || type.IsSubclassOf(target)));
     }
     else
     {
         return(TargetTypes.Any(target => target == type));
     }
 }
 /// <summary>
 /// Says, is current attribute instance can be used to convert marked <c>object</c> from <paramref name="valueType"/>
 /// </summary>
 public bool IsUsableFor(Type valueType)
 {
     return(TargetTypes.Any(x => TypeCache.IsAssignableFrom(valueType, x))); //bug: it's may be wrong
 }
Esempio n. 3
0
 public bool CanTarget(TargetType target)
 {
     return(TargetTypes.Any(targetType => target == targetType));
 }