OnCreatedConcern<TComponent>
using Castle.Core;
namespace Castle.MicroKernel.LifecycleConcerns
{
public class OnCreatedConcern<TComponent> : ICommissionConcern
{
private readonly LifecycleActionDelegate<TComponent> action;
private readonly IKernel kernel;
public OnCreatedConcern(LifecycleActionDelegate<TComponent> action, IKernel kernel)
{
this.action = action;
this.kernel = kernel;
}
public void Apply(ComponentModel model, object component)
{
TComponent item = (TComponent)component;
action(kernel, item);
}
}
}