C# Класс Castle.MicroKernel.Registration.ServiceDescriptor

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AllInterfaces ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor

Uses all interfaces implemented by the type (or its base types) as well as their base interfaces.

Base ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor

Uses the base type matched on.

DefaultInterfaces ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor

Uses all interfaces that have names matched by implementation type name. Matches Foo to IFoo, SuperFooExtended to IFoo and IFooExtended etc

FirstInterface ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor

Uses the first interface of a type. This method has non-deterministic behavior when type implements more than one interface!

FromInterface ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor

Uses base type to lookup the sub interface.

FromInterface ( Type implements ) : Castle.MicroKernel.Registration.BasedOnDescriptor

Uses implements to lookup the sub interface. For example: if you have IService and IProductService : ISomeInterface, IService, ISomeOtherInterface. When you call FromInterface(typeof(IService)) then IProductService will be used. Useful when you want to register _all_ your services and but not want to specify all of them.

Select ( IEnumerable types ) : Castle.MicroKernel.Registration.BasedOnDescriptor

Assigns the supplied service types.

Select ( ServiceSelector selector ) : Castle.MicroKernel.Registration.BasedOnDescriptor

Assigns a custom service selection strategy.

Self ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor

Uses the type itself.

Приватные методы

Метод Описание
AddFromInterface ( Type type, Type implements, ICollection matches ) : void
GetInterfaceName ( Type @interface ) : string
GetServices ( Type type, Type baseType ) : ICollection
GetTopLevelInterfaces ( Type type ) : IEnumerable
ServiceDescriptor ( Castle.MicroKernel.Registration.BasedOnDescriptor basedOnDescriptor ) : System
WorkaroundCLRBug ( Type serviceType ) : Type

This is a workaround for a CLR bug in which GetInterfaces() returns interfaces with no implementations.

Описание методов

AllInterfaces() публичный Метод

Uses all interfaces implemented by the type (or its base types) as well as their base interfaces.
public AllInterfaces ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor
Результат Castle.MicroKernel.Registration.BasedOnDescriptor

Base() публичный Метод

Uses the base type matched on.
public Base ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor
Результат Castle.MicroKernel.Registration.BasedOnDescriptor

DefaultInterfaces() публичный Метод

Uses all interfaces that have names matched by implementation type name. Matches Foo to IFoo, SuperFooExtended to IFoo and IFooExtended etc
public DefaultInterfaces ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor
Результат Castle.MicroKernel.Registration.BasedOnDescriptor

FirstInterface() публичный Метод

Uses the first interface of a type. This method has non-deterministic behavior when type implements more than one interface!
public FirstInterface ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor
Результат Castle.MicroKernel.Registration.BasedOnDescriptor

FromInterface() публичный Метод

Uses base type to lookup the sub interface.
public FromInterface ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor
Результат Castle.MicroKernel.Registration.BasedOnDescriptor

FromInterface() публичный Метод

Uses implements to lookup the sub interface. For example: if you have IService and IProductService : ISomeInterface, IService, ISomeOtherInterface. When you call FromInterface(typeof(IService)) then IProductService will be used. Useful when you want to register _all_ your services and but not want to specify all of them.
public FromInterface ( Type implements ) : Castle.MicroKernel.Registration.BasedOnDescriptor
implements System.Type
Результат Castle.MicroKernel.Registration.BasedOnDescriptor

Select() публичный Метод

Assigns the supplied service types.
public Select ( IEnumerable types ) : Castle.MicroKernel.Registration.BasedOnDescriptor
types IEnumerable
Результат Castle.MicroKernel.Registration.BasedOnDescriptor

Select() публичный Метод

Assigns a custom service selection strategy.
public Select ( ServiceSelector selector ) : Castle.MicroKernel.Registration.BasedOnDescriptor
selector ServiceSelector
Результат Castle.MicroKernel.Registration.BasedOnDescriptor

Self() публичный Метод

Uses the type itself.
public Self ( ) : Castle.MicroKernel.Registration.BasedOnDescriptor
Результат Castle.MicroKernel.Registration.BasedOnDescriptor