C# Class Command.Registry

Provides a registry of discovered Commands and Factories, as well as methods for discovering them.
Afficher le fichier Open project: agardiner/hfmcmd Class Usage Examples

Protected Properties

Свойство Type Description
_alternates List
_log log4net.ILog

Méthodes publiques

Méthode Description
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

Method Details

Add() public méthode

Registers the specified Command instance.
public Add ( Command cmd ) : void
cmd Command
Résultat void

Add() public méthode

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
Résultat void

Commands() public méthode

Returns each Command that is currently registered.
public Commands ( ) : IEnumerable
Résultat IEnumerable

Contains() public méthode

Checks to see if a Factory for the specified type is available.
public Contains ( Type type ) : bool
type System.Type
Résultat bool

Contains() public méthode

Checks to see if a command with the given name is available.
public Contains ( string cmdName ) : bool
cmdName string
Résultat bool

GetAlternates() public méthode

Returns an IEnumerable of the alternate Factory objects registered for the specified type.
public GetAlternates ( Type type ) : IEnumerable
type System.Type
Résultat IEnumerable

GetFactory() public méthode

Returns the Factory instance for objects of the specified Type.
public GetFactory ( Type type ) : Factory
type System.Type
Résultat Factory

GetSettings() public méthode

Returns a list of the settings an ISettingsCollection instance holds.
public GetSettings ( Type type ) : List
type System.Type
Résultat List

RegisterClass() public méthode

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
Résultat void

RegisterNamespace() public méthode

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
Résultat void

RegisterNamespace() public méthode

Registers commands (i.e. methods tagged with the Command attribute) in the current assembly.
public RegisterNamespace ( string ns ) : void
ns string
Résultat void

Registry() public méthode

public Registry ( ) : System
Résultat System

this() public méthode

public this ( string cmdName ) : Command
cmdName string
Résultat Command

Property Details

_alternates protected_oe property

protected List _alternates
Résultat List

_log protected_oe static_oe property

protected static ILog,log4net _log
Résultat log4net.ILog