private static void CatalogResource(MapResourceBaseAttribute resourceAttribute, Type targetType) { // we get the resource type var _resourceType = resourceAttribute.GetResourceType(targetType); if (_resourceType == null) { throw new InvalidOperationException( string.Format(CANNOT_RESOLVE_ON, targetType.FullName)); } // we get the locator var _resourceLocator = resourceAttribute.GetResourceLocator(targetType); if (_resourceLocator == null) { throw new InvalidOperationException( string.Format(CANNOT_RESOLVE_IRESOURCELOCATOR, targetType.FullName)); } // we get the resource catalog RegisterResourceLocator(_resourceType, _resourceLocator, resourceAttribute.IsDefaultResource); }
public PendingMapping(MapResourceBaseAttribute resourceAttribute, Type targetType) { ResourceAttribute = resourceAttribute; TargetType = targetType; }