Esempio n. 1
0
        public void InitializeExtension(ExtensionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            this.container = context.Container;
            this.context = context;
            Initialize();
        }
        /// <summary>
        /// The container calls this method when the extension is added.
        /// </summary>
        /// <param name="context">A <see cref="ExtensionContext"/> instance that gives the
        /// extension access to the internals of the container.</param>
        public void InitializeExtension(ExtensionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            this.container = context.Container;
            this.context   = context;
            Initialize();
        }
Esempio n. 3
0
 /// <summary>
 /// Create a new <see cref="LifetimeManagerFactory"/> that will
 /// return instances of the given type, creating them by
 /// resolving through the container.
 /// </summary>
 /// <param name="containerContext">Container to resolve with.</param>
 /// <param name="lifetimeType">Type of LifetimeManager to create.</param>
 public LifetimeManagerFactory(ExtensionContext containerContext, Type lifetimeType)
 {
     this.containerContext = containerContext;
     LifetimeType = lifetimeType;
 }
 /// <summary>
 /// Construct a new <see cref="ChildContainerCreatedEventArgs"/> object with the
 /// given child container object.
 /// </summary>
 /// <param name="childContext">An <see cref="ExtensionContext"/> for the newly created child
 /// container.</param>
 public ChildContainerCreatedEventArgs(ExtensionContext childContext)
 {
     this.ChildContext = childContext;
 }
 /// <summary>
 /// Construct a new <see cref="ChildContainerCreatedEventArgs"/> object with the
 /// given child container object.
 /// </summary>
 /// <param name="childContext">An <see cref="ExtensionContext"/> for the newly created child
 /// container.</param>
 public ChildContainerCreatedEventArgs(ExtensionContext childContext)
 {
     this.ChildContext = childContext;
 }
Esempio n. 6
0
 /// <summary>
 /// Create a new <see cref="LifetimeManagerFactory"/> that will
 /// return instances of the given type, creating them by
 /// resolving through the container.
 /// </summary>
 /// <param name="containerContext">Container to resolve with.</param>
 /// <param name="lifetimeType">Type of LifetimeManager to create.</param>
 public LifetimeManagerFactory(ExtensionContext containerContext, Type lifetimeType)
 {
     this.containerContext = containerContext;
     LifetimeType          = lifetimeType;
 }