public void Register(Type iface, Type handler) { if (!iface.IsInterface) { throw new ArgumentException("iface should be interface"); } if (!iface.IsAssignableFrom(handler)) { throw new ArgumentException("handler should implement iface"); } Register(_extractor.GetTargetName(iface), handler); }
public void Register <TInterface, THandler>(THandler instance) { _instanceHandlers.Add(_extractor.GetTargetName(typeof(TInterface)), instance); }