예제 #1
0
        /// <summary>
        /// Create a <see cref="UnityContainer"/> with the given parent container.
        /// </summary>
        /// <param name="parent">The parent <see cref="UnityContainer"/>. The current object
        /// will apply its own settings first, and then check the parent for additional ones.</param>
        private UnityContainer(UnityContainer parent)
        {
            this.parent = parent;

            if (parent != null)
            {
                parent.lifetimeContainer.Add(this);
            }

            InitializeBuilderState();
            // Put a noop at the beginning of each of our events so we don't have to worry
            // about nulls
            Registering           += delegate { };
            RegisteringInstance   += delegate { };
            ChildContainerCreated += delegate { };

            // Every container gets the default behavior
            this.AddExtension(new UnityDefaultBehaviorExtension());

#pragma warning disable 618
            this.AddExtension(new InjectedMembers());
#pragma warning restore 618
        }
예제 #2
0
 public ExtensionContextImpl(UnityContainer container)
 {
     this.container = container;
 }