internal IUnityContainer GetOrCreateContainer(string containerName)
        {
            var container = GetContainer(containerName);

            if (container == null)
            {
                lock (_containers)
                {
                    container = GetContainer(containerName);
                    if (container == null)
                    {
                        container = new UnityConfigContainer(containerName, new InterfaceMapper());
                        _containers.Add(containerName, container);
                    }
                }
            }
            return(container);
        }
 public object Create(object parent, object configContext, XmlNode section)
 {
     foreach (XmlNode node in section.ChildNodes)
     {
         switch (node.Name)
         {
         case "containers":
         {
             foreach (XmlNode item in node.ChildNodes)
             {
                 if (item.Name == "container")
                 {
                     UnityConfigContainer container = GetContainerFromXmlNode(item);
                     _containers.Add(container.Name, container);
                 }
             }
         }
         break;
         }
     }
     return(this);
 }