static public bool TryGetCustomForTypeAttributeOfTypeTypeDistance(this ICustomAttributeProvider item, Type attribute_type, Type type, out int distance) { ForTypeAttribute attribute = item.GetCustomAttributeOfSubType <ForTypeAttribute>(attribute_type, false); if (attribute != null) { distance = attribute.GetTypeDistance(type); return(true); } distance = int.MaxValue; return(false); }