Ejemplo n.º 1
0
 private static IDependency GetOrCreateByType(string id, Type dependencyType, IKernel kernel, bool injectMany)
 {
     IDependency info;
     if (!DependencyList.TryGetValue(dependencyType, out info))
     {
         if (injectMany)
             info = new BatchDependency(dependencyType, kernel);
         else
             info = new Dependency(dependencyType, kernel);
         lock (Mutex)
             DependencyList[dependencyType] = info;
     }
     return info;
 }
Ejemplo n.º 2
0
        private static IDependency GetOrCreateByType(string id, Type dependencyType, IKernel kernel, bool injectMany)
        {
            IDependency info;

            if (!DependencyList.TryGetValue(dependencyType, out info))
            {
                if (injectMany)
                {
                    info = new BatchDependency(dependencyType, kernel);
                }
                else
                {
                    info = new Dependency(dependencyType, kernel);
                }
                lock (Mutex)
                    DependencyList[dependencyType] = info;
            }
            return(info);
        }