Beispiel #1
0
 public void RegisterSingleton <TInterface>(object value)
 {
     IOCException.CheckImplementedInterface <TInterface>(value.GetType());
     if (IsRegisteredSingleton <TInterface>())
     {
         singletonTable[typeof(TInterface)] = value;
         return;
     }
     singletonTable.Add(typeof(TInterface), value);
 }
Beispiel #2
0
 public void Register <TInterface, TImplement>()
 {
     IOCException.CheckImplementedInterface <TInterface, TImplement>();
     if (IsRegisteredImplement <TInterface>())
     {
         interfaceTable[typeof(TInterface)] = typeof(TImplement);
         return;
     }
     interfaceTable.Add(typeof(TInterface), typeof(TImplement));
 }