Skip to content

Splat 1.4.0

Choose a tag to compare

@anaisbetts anaisbetts released this 25 Jul 07:12

What's New

Service Registration Callbacks (#66)

Thanks to @tberman, you can now be notified whenever a certain type or type + contract is registered.

int count = 0;
Locator.CurrentMutable.ServiceRegistrationCallback(typeof(Toaster), null, cancel => {
    count++;
    if (count > 3) {
        Console.WriteLine("You've got way too many toasters!");
        cancel.Dispose();    // No more callback notifications 
    }
});