C# Класс Command.Registry

Provides a registry of discovered Commands and Factories, as well as methods for discovering them.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_alternates List
_log log4net.ILog

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

Метод Описание
Add ( Command cmd ) : void

Registers the specified Command instance.

Add ( Factory factory ) : void

Registers the specified Factory instance as an alternate mechanism for obtaining objects of the Factory return type. An alternate means will be tried when no other non-alternate path to create an object can be found from the current context state.

Commands ( ) : IEnumerable

Returns each Command that is currently registered.

Contains ( Type type ) : bool

Checks to see if a Factory for the specified type is available.

Contains ( string cmdName ) : bool

Checks to see if a command with the given name is available.

GetAlternates ( Type type ) : IEnumerable

Returns an IEnumerable of the alternate Factory objects registered for the specified type.

GetFactory ( Type type ) : Factory

Returns the Factory instance for objects of the specified Type.

GetSettings ( Type type ) : List

Returns a list of the settings an ISettingsCollection instance holds.

RegisterClass ( Type t ) : void

Registers commands and factories from the supplied class. Commands must be tagged with the attribute Command to be locatable.

RegisterNamespace ( Assembly asm, string ns ) : void

Registers commands from the supplied assembly. Commands methods must be tagged with the attribute Command to be locatable.

RegisterNamespace ( string ns ) : void

Registers commands (i.e. methods tagged with the Command attribute) in the current assembly.

Registry ( ) : System
this ( string cmdName ) : Command

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

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

Registers the specified Command instance.
public Add ( Command cmd ) : void
cmd Command
Результат void

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

Registers the specified Factory instance as an alternate mechanism for obtaining objects of the Factory return type. An alternate means will be tried when no other non-alternate path to create an object can be found from the current context state.
public Add ( Factory factory ) : void
factory Factory
Результат void

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

Returns each Command that is currently registered.
public Commands ( ) : IEnumerable
Результат IEnumerable

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

Checks to see if a Factory for the specified type is available.
public Contains ( Type type ) : bool
type System.Type
Результат bool

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

Checks to see if a command with the given name is available.
public Contains ( string cmdName ) : bool
cmdName string
Результат bool

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

Returns an IEnumerable of the alternate Factory objects registered for the specified type.
public GetAlternates ( Type type ) : IEnumerable
type System.Type
Результат IEnumerable

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

Returns the Factory instance for objects of the specified Type.
public GetFactory ( Type type ) : Factory
type System.Type
Результат Factory

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

Returns a list of the settings an ISettingsCollection instance holds.
public GetSettings ( Type type ) : List
type System.Type
Результат List

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

Registers commands and factories from the supplied class. Commands must be tagged with the attribute Command to be locatable.
public RegisterClass ( Type t ) : void
t System.Type
Результат void

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

Registers commands from the supplied assembly. Commands methods must be tagged with the attribute Command to be locatable.
public RegisterNamespace ( Assembly asm, string ns ) : void
asm System.Reflection.Assembly
ns string
Результат void

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

Registers commands (i.e. methods tagged with the Command attribute) in the current assembly.
public RegisterNamespace ( string ns ) : void
ns string
Результат void

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

public Registry ( ) : System
Результат System

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

public this ( string cmdName ) : Command
cmdName string
Результат Command

Описание свойств

_alternates защищенное свойство

protected List _alternates
Результат List

_log защищенное статическое свойство

protected static ILog,log4net _log
Результат log4net.ILog