<PackageReference Include="Castle.Windsor" Version="4.1.1" />

PotentiallyMisconfiguredComponents

using Castle.Core.Internal; using Castle.MicroKernel; using Castle.Windsor.Diagnostics.DebuggerViews; using System; using System.Collections.Generic; using System.Linq; namespace Castle.Windsor.Diagnostics.Extensions { public class PotentiallyMisconfiguredComponents : AbstractContainerDebuggerExtension { private const string name = "Potentially misconfigured components"; private IPotentiallyMisconfiguredComponentsDiagnostic diagnostic; public static string Name => "Potentially misconfigured components"; public override IEnumerable<DebuggerViewItem> Attach() { IHandler[] array = diagnostic.Inspect(); if (array.Length == 0) return Enumerable.Empty<DebuggerViewItem>(); Array.Sort(array, (IHandler f, IHandler s) => f.ComponentModel.Name.CompareTo(s.ComponentModel.Name)); ComponentDebuggerView[] array2 = array.ConvertAll(base.DefaultComponentView); return new DebuggerViewItem[1] { new DebuggerViewItem("Potentially misconfigured components", "Count = " + array2.Length, array2) }; } public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost) { diagnostic = new PotentiallyMisconfiguredComponentsDiagnostic(kernel); diagnosticsHost.AddDiagnostic(diagnostic); } } }