PotentiallyMisconfiguredComponentsDiagnostic
public class PotentiallyMisconfiguredComponentsDiagnostic : IPotentiallyMisconfiguredComponentsDiagnostic, IDiagnostic<IHandler[]>
using Castle.Core.Internal;
using Castle.MicroKernel;
namespace Castle.Windsor.Diagnostics
{
public class PotentiallyMisconfiguredComponentsDiagnostic : IPotentiallyMisconfiguredComponentsDiagnostic, IDiagnostic<IHandler[]>
{
private readonly IKernel kernel;
public PotentiallyMisconfiguredComponentsDiagnostic(IKernel kernel)
{
this.kernel = kernel;
}
public IHandler[] Inspect()
{
return kernel.GetAssignableHandlers(typeof(object)).FindAll(IsWaitingForDependencies);
}
private bool IsWaitingForDependencies(IHandler handler)
{
return handler.CurrentState == HandlerState.WaitingDependency;
}
}
}