/// <summary> /// Register an Action to perform on the object created by this Instance /// before it is returned to the caller /// </summary> /// <param name="handler"></param> /// <returns></returns> public SmartInstance <T> OnCreation(Action <IContext, T> handler) { var interceptor = new StartupInterceptor <T>(handler); Interceptor = interceptor; return(this); }
/// <summary> /// Register an Action to perform on the object created by this Instance /// before it is returned to the caller /// </summary> /// <param name="handler"></param> /// <returns></returns> public SmartInstance <T> OnCreation(Action <T> handler) { var interceptor = new StartupInterceptor <T>((c, o) => handler(o)); Interceptor = interceptor; return(this); }
/// <summary> /// Register an Action to perform on the object created by this Instance /// before it is returned to the caller /// </summary> /// <typeparam name="T"></typeparam> /// <param name="handler"></param> /// <returns></returns> public ConfiguredInstance OnCreation <T>(Action <IContext, T> handler) { var interceptor = new StartupInterceptor <T>(handler); Interceptor = interceptor; return(this); }
/// <summary> /// Register an Action to perform on the object created by this Instance /// before it is returned to the caller /// </summary> /// <typeparam name="TYPE"></typeparam> /// <param name="handler"></param> /// <returns></returns> public T OnCreation <TYPE>(Action <TYPE> handler) { var interceptor = new StartupInterceptor <TYPE>((c, o) => handler(o)); Interceptor = interceptor; return(thisInstance); }
/// <summary> /// Register an Action to perform on the object created by this Instance /// before it is returned to the caller /// </summary> /// <typeparam name="T"></typeparam> /// <param name="handler"></param> /// <returns></returns> public ConfiguredInstance OnCreation <T>(Action <T> handler) { var interceptor = new StartupInterceptor <T>((c, o) => handler(o)); Interceptor = interceptor; return(this); }