Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 static public int GetTypeDistance(this ForTypeAttribute item, Type type)
 {
     return(item.GetTargetType().GetTypeDistance(type));
 }