Castle Windsor 3.0 ComponentRegistration "ServiceType"

Mau*_*nti 5 castle-windsor

I'm moving some code from Castle 2.5.2 to 3.0, I have a set of predefined registrations (in my boot code) that does some stuff based on conventions such as:

container.Register
(
    AllTypes.FromAssemblyInDirectory( new AssemblyFilter( "." ) )
        .IncludeNonPublicTypes()
        .Where( t => conventions.IsViewModel( t ) && !conventions.IsExcluded( t ) )
        .WithService.Select( ( type, baseTypes ) => conventions.SelectViewModelContracts( type ) )
        .Configure( r =>
        {
                    r.Properties( PropertyFilter.IgnoreAll );

            if( conventions.IsShellViewModel( r ) )
            {
                r.LifeStyle.Is( LifestyleType.Singleton );
            }
            else
            {
                r.LifeStyle.Is( LifestyleType.Transient );
            }
        } )
);
Run Code Online (Sandbox Code Playgroud)

在Windsor 2.5.2中,ComponentRegistration类具有ServiceType属性,在3.0中有一个Services属性,但是"内部受保护".

我的约定处理依赖于我需要知道哪些服务.

我怎样才能获得这些信息?

.M

小智 0

.WithServiceSelect 不能满足您的需求吗?