C# 클래스 GuaranteedRate.Sextant.Config.JsonEncompassConfig

provides a simple config fild parser for JSON files. Defaults to ASCII encoding
상속: IEncompassConfig
파일 보기 프로젝트 열기: Guaranteed-Rate/GuaranteedRate.Sextant 1 사용 예제들

공개 메소드들

메소드 설명
GetConfigGroup ( string key ) : IEncompassConfig

Returns a sub-section of the config.

GetKeys ( ) : ICollection

Returns all keys in the json config.

GetValue ( string key, bool defaultVal ) : bool

Returns the value of the given key

GetValue ( string key, string defaultVal = null ) : string

Returns the value of the given key

Init ( Session session ) : bool

Initializes the config from a default "sextant.json" file.

Init ( Session session, string configPath ) : bool

Initializes the config from this file.

Init ( Session session, string configPath, Encoding encoding ) : bool

Initializes the config from this file.

Init ( string configAsString ) : bool

Loads the config from the given string. Useful for testing.

JsonEncompassConfig ( ) : System

Default constructor.

Reload ( Session session ) : bool

Reloads the config from a default "sextant.json" file.

Reload ( Session session, string configPath ) : bool

Reloads the config file

비공개 메소드들

메소드 설명
JsonEncompassConfig ( string configText ) : System

메소드 상세

GetConfigGroup() 공개 메소드

Returns a sub-section of the config.
public GetConfigGroup ( string key ) : IEncompassConfig
key string Json key of the section you want.
리턴 IEncompassConfig

GetKeys() 공개 메소드

Returns all keys in the json config.
public GetKeys ( ) : ICollection
리턴 ICollection

GetValue() 공개 메소드

Returns the value of the given key
public GetValue ( string key, bool defaultVal ) : bool
key string Full path to the key(e.g. "MyKey" or "Keys[0].MySubKey")
defaultVal bool Default value if the key is null
리턴 bool

GetValue() 공개 메소드

Returns the value of the given key
public GetValue ( string key, string defaultVal = null ) : string
key string Full path to the key(e.g. "MyKey" or "Keys[0].MySubKey")
defaultVal string Default value if the key is null
리턴 string

Init() 공개 메소드

Initializes the config from a default "sextant.json" file.
public Init ( Session session ) : bool
session Session Current Encompass session
리턴 bool

Init() 공개 메소드

Initializes the config from this file.
public Init ( Session session, string configPath ) : bool
session Session Current Encompass session
configPath string Name of the config file (e.g. "myconfig.json")
리턴 bool

Init() 공개 메소드

Initializes the config from this file.
public Init ( Session session, string configPath, Encoding encoding ) : bool
session Session Current Encompass session
configPath string Name of the config file (e.g. "myconfig.json")
encoding System.Text.Encoding Encoding of the file.
리턴 bool

Init() 공개 메소드

Loads the config from the given string. Useful for testing.
public Init ( string configAsString ) : bool
configAsString string The json string
리턴 bool

JsonEncompassConfig() 공개 메소드

Default constructor.
public JsonEncompassConfig ( ) : System
리턴 System

Reload() 공개 메소드

Reloads the config from a default "sextant.json" file.
public Reload ( Session session ) : bool
session Session Current Encompass session
리턴 bool

Reload() 공개 메소드

Reloads the config file
public Reload ( Session session, string configPath ) : bool
session Session Current Encompass session
configPath string Name of the config file e.g. "foo.json"
리턴 bool