Inject() public static method

Injects the specified instance by using the container's kernel.
public static Inject ( object instance ) : void
instance object The instance to inject.
return void
コード例 #1
0
 /// <summary>
 /// Asks the kernel to inject this instance.
 /// </summary>
 protected virtual void RequestActivation()
 {
     KernelContainer.Inject(this);
 }
コード例 #2
0
 /// <summary>
 /// Enables processing of HTTP Web requests by a custom HttpHandler that implements the <see cref="T:System.Web.IHttpHandler"></see> interface.
 /// </summary>
 /// <param name="context">An <see cref="T:System.Web.HttpContext"></see> object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests.</param>
 public void ProcessRequest(HttpContext context)
 {
     KernelContainer.Inject(this);
     this.DoProcessRequest(context);
 }
コード例 #3
0
 /// <summary>
 /// Raises the <see cref="E:System.Web.UI.Control.Init"></see> event to initialize the page.
 /// </summary>
 /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param>
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     KernelContainer.Inject(this);
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebServiceBase"/> class.
 /// </summary>
 protected WebServiceBase()
 {
     KernelContainer.Inject(this);
 }