Repository navigation
Splat 1.4.0
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
}
});