internal static bool TryGetResourceInfoAttribute(this Type type, out ResourceInfoAttribute resourceInfoAttribute) { if (type == null) { throw new ArgumentNullException(nameof(type)); } resourceInfoAttribute = type .GetCustomAttributes(typeof(ResourceInfoAttribute), false) .OfType <ResourceInfoAttribute>() .FirstOrDefault(); return(resourceInfoAttribute != null); }
public static bool TryGet(Type type, out ResourceInfoAttribute ria) { if (type == null) { throw new ArgumentNullException(nameof(type)); } if (!attributeCache.TryGetValue(type, out ria)) { // Only cache if not null var checkAttr = type.GetCustomAttributes(typeof(ResourceInfoAttribute), false).OfType <ResourceInfoAttribute>() .FirstOrDefault(); if (checkAttr == null) { return(false); } ria = attributeCache.GetOrAdd(type, checkAttr); } return(ria != null); }
public bool TryGetResourceInfoForType(Type type, out ResourceInfoAttribute resourceInfo) { return(this.client.TryGetResourceInfoForType(type, out resourceInfo)); }
public bool TryGetResourceInfoForType(Type type, out ResourceInfoAttribute resourceInfo) { return(ResourceInfoAttribute.TryGet(type, out resourceInfo)); }
public virtual bool TryGetResourceInfoForType(Type type, out ResourceInfoAttribute resourceInfo) { return(this.typeMapper.TryGetResourceInfoForType(type, out resourceInfo)); }