예제 #1
0
 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);
 }
예제 #2
0
 public void Register <TInterface, THandler>(THandler instance)
 {
     _instanceHandlers.Add(_extractor.GetTargetName(typeof(TInterface)), instance);
 }