C# 클래스 Command.Context

Records the current context within which Commands are executed. A Context is like a session object; it holds the current set of live object instances on which commands will be invoked. The Context is also able to use the Factory registration information to create new object instances as required, provided they can be created from objects currently in the context.
파일 보기 프로젝트 열기: agardiner/hfmcmd

공개 프로퍼티들

프로퍼티 타입 설명
MissingArgHandler object>.Func

보호된 프로퍼티들

프로퍼티 타입 설명
_context List
_dependencyList List>.Dictionary
_log log4net.ILog
_purgeList List
_registry Registry

공개 메소드들

메소드 설명
Context ( Registry registry ) : System
Context ( Registry registry, object>.Func missingArgHandler ) : System
FindPathToType ( Type t, Command cmd ) : Stack

Determines the sequence of command invocations, property accesses, and constructor calls that are required to instantiate an object of the requested type, given the current state of the context.

GetSettings ( Type type ) : List

Returns the SettingAttributes for the specified type.

HasObject ( Type type ) : bool

Returns true if the Context currently contains an instance of the requested type.

Invoke ( string command, object>.Dictionary args ) : object

Invoke an instance of the named command, using the supplied arguments dictionary to obtain parameter values. If necessary, this will execute Factory constructors, properties, and commands to obtain the necessary source object on which to invoke the command.

Remove ( Type type ) : object

Removes the first object that is an instance of type.

Set ( object value ) : void

Sets an object in the context. Only a single object of a given type is permitted, so any existing object of this type is replaced.

Set ( object value, object dependency ) : void

Sets an object in the context. Only a single object of a given type is permitted, so any existing object of this type is replaced.

Verify ( ) : void

Verifies that all commands can be invoked successfully.

this ( Type type ) : object

보호된 메소드들

메소드 설명
RemoveDependencies ( object val ) : void

비공개 메소드들

메소드 설명
ConvertSetting ( object val, ISetting setting ) : object
Instantiate ( Factory step, object>.Dictionary args ) : object
InvokeCommand ( Command cmd, object>.Dictionary args ) : object
InvokeConstructor ( ConstructorInfo ctor ) : object
LogSettingNameValue ( StringBuilder sb, string name, ISetting setting, object val ) : void
LogSettingValue ( StringBuilder sb, ISetting setting, object val ) : void
PrepareCommandArguments ( Command cmd, object>.Dictionary args, string &paramLog ) : object[]
PrepareSettingsCollectionArg ( Command cmd, CommandParameter param, object>.Dictionary args, StringBuilder sb ) : ISettingsCollection
PurgeSingleUseObjects ( ) : void

메소드 상세

Context() 공개 메소드

public Context ( Registry registry ) : System
registry Registry
리턴 System

Context() 공개 메소드

public Context ( Registry registry, object>.Func missingArgHandler ) : System
registry Registry
missingArgHandler object>.Func
리턴 System

FindPathToType() 공개 메소드

Determines the sequence of command invocations, property accesses, and constructor calls that are required to instantiate an object of the requested type, given the current state of the context.
Throws ContextException if an object of the desired type /// cannot be created from the current context. ///
public FindPathToType ( Type t, Command cmd ) : Stack
t System.Type
cmd Command
리턴 Stack

GetSettings() 공개 메소드

Returns the SettingAttributes for the specified type.
public GetSettings ( Type type ) : List
type System.Type
리턴 List

HasObject() 공개 메소드

Returns true if the Context currently contains an instance of the requested type.
public HasObject ( Type type ) : bool
type System.Type
리턴 bool

Invoke() 공개 메소드

Invoke an instance of the named command, using the supplied arguments dictionary to obtain parameter values. If necessary, this will execute Factory constructors, properties, and commands to obtain the necessary source object on which to invoke the command.
public Invoke ( string command, object>.Dictionary args ) : object
command string
args object>.Dictionary
리턴 object

Remove() 공개 메소드

Removes the first object that is an instance of type.
public Remove ( Type type ) : object
type System.Type
리턴 object

RemoveDependencies() 보호된 메소드

protected RemoveDependencies ( object val ) : void
val object
리턴 void

Set() 공개 메소드

Sets an object in the context. Only a single object of a given type is permitted, so any existing object of this type is replaced.
public Set ( object value ) : void
value object
리턴 void

Set() 공개 메소드

Sets an object in the context. Only a single object of a given type is permitted, so any existing object of this type is replaced.
public Set ( object value, object dependency ) : void
value object
dependency object
리턴 void

Verify() 공개 메소드

Verifies that all commands can be invoked successfully.
public Verify ( ) : void
리턴 void

this() 공개 메소드

public this ( Type type ) : object
type System.Type
리턴 object

프로퍼티 상세

MissingArgHandler 공개적으로 프로퍼티

public Func MissingArgHandler
리턴 object>.Func

_context 보호되어 있는 프로퍼티

protected List _context
리턴 List

_dependencyList 보호되어 있는 프로퍼티

protected Dictionary> _dependencyList
리턴 List>.Dictionary

_log 보호되어 있는 정적으로 프로퍼티

protected static ILog,log4net _log
리턴 log4net.ILog

_purgeList 보호되어 있는 프로퍼티

protected List _purgeList
리턴 List

_registry 보호되어 있는 프로퍼티

protected Registry,Command _registry
리턴 Registry