private void RegisterCollision(string name, ResourceRegistration registration)
 {
     // We maintain an internal list of resource collisions for debugging purposes.
     // In a successfully configured system, this should be empty.
     List<ResourceRegistration> registrations;
     if (!collisions.TryGetValue(name, out registrations))
     {
         registrations = new List<ResourceRegistration>();
         collisions.Add(name, registrations);
     }
     registrations.Add(registration);
 }
 public void RegisterResource(string name, Assembly assembly, string resourceKey)
 {
     var registration = new ResourceRegistration { Assembly = assembly, Name = resourceKey};
     if (!registrations.ContainsKey(name))
     {
         registrations.Add(name, registration);
     }
     else
     {
         RegisterCollision(name, registration);
     }
 }