Example #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;
 }
Example #2
0
        private static IDependency GetOrCreateById(string id, Type dependencyType, IKernel kernel)
        {
            IDependency info;
            if (!StrDependencyList.TryGetValue(id, out info))
            {

                var tmpInfo = new Dependency(id, dependencyType, kernel);
                lock (Mutex)
                    StrDependencyList[id] = tmpInfo;

                info = tmpInfo;

            }
            return info;
        }