PotentiallyMisconfiguredComponentsDiagnostic
public class PotentiallyMisconfiguredComponentsDiagnostic : IPotentiallyMisconfiguredComponentsDiagnostic, IDiagnostic<IHandler[]>
using Castle.Core.Internal;
using Castle.MicroKernel;
using System;
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 CollectionExtensions.FindAll<IHandler>(kernel.GetAssignableHandlers(typeof(object)), (Predicate<IHandler>)IsWaitingForDependencies);
}
private bool IsWaitingForDependencies(IHandler handler)
{
return handler.CurrentState == HandlerState.WaitingDependency;
}
}
}