private static void Register(RootDependencyContainer container)
 {
     if (!Containers.Contains(container))
     {
         Containers.Add(container);
     }
 }
Exemple #2
0
        /// <summary>
        /// Return a collection of all objects registered in containers.
        /// </summary>
        /// <returns>A collection of all registered objects.</returns>
        public static IEnumerable <object> GetAllRegisteredObjects()
        {
            var objects = new HashSet <object>();

            for (var index = 0; index < RootDependencyContainer.InstancesCount; index++)
            {
                var rootContainer = RootDependencyContainer.GetInstance(index);
                rootContainer.GetAllRegisteredObjects(objects);
            }

            return(objects);
        }
 private static void Unregister(RootDependencyContainer container) => Containers.Remove(container);