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 }
public bool CanTarget(TargetType target) { return(TargetTypes.Any(targetType => target == targetType)); }