C# Class SIPSorcery.Sys.AppState

Inheritance: IConfigurationSectionHandler
ファイルを表示 Open project: sipsorcery/sipsorcery

Public Properties

Property Type Description
CurrentDirectory string
NewLine string
logger log4net.ILog

Public Methods

Method Description
ConfigureConsoleLogger ( ) : void

Configures the logging object to use a console logger. This would normally be used as a fallback when either the application does not have any logging configuration or there is an error in it.

Create ( object parent, object context, XmlNode configSection ) : object

Handler for processing the App.Config file and retrieving a custom XML node.

GetConfigNodeValue ( XmlNode configNode, string nodeName ) : string
GetConfigSetting ( string key ) : string

Wrapper around the object holding the application configuration settings extracted from the App.Config file.

GetConfigSettingAsBool ( string key ) : bool
GetLogger ( string logName ) : log4net.ILog
GetSection ( string sectionName ) : object
LoadCertificate ( StoreLocation storeLocation, string certificateSubject, bool checkValidity ) : X509Certificate2

Attempts to load an X509 certificate from a Windows OS certificate store.

ToAbsoluteDirectoryPath ( string directoryPath ) : string

Checks whether a directory path represents a relative or absolute path and if it's relative converts it to an absolute one by prefixing it with the application's base directory.

ToAbsoluteFilePath ( string filePath ) : string

Checks whether a file path represents a relative or absolute path and if it's relative converts it to an absolute one by prefixing it with the application's base directory.

Private Methods

Method Description
AppState ( ) : System
GetEncryptedSettingsCertificate ( ) : X509Certificate2

Method Details

ConfigureConsoleLogger() public static method

Configures the logging object to use a console logger. This would normally be used as a fallback when either the application does not have any logging configuration or there is an error in it.
public static ConfigureConsoleLogger ( ) : void
return void

Create() public method

Handler for processing the App.Config file and retrieving a custom XML node.
public Create ( object parent, object context, XmlNode configSection ) : object
parent object
context object
configSection System.Xml.XmlNode
return object

GetConfigNodeValue() public static method

public static GetConfigNodeValue ( XmlNode configNode, string nodeName ) : string
configNode System.Xml.XmlNode
nodeName string
return string

GetConfigSetting() public static method

Wrapper around the object holding the application configuration settings extracted from the App.Config file.
public static GetConfigSetting ( string key ) : string
key string The name of the configuration setting wanted.
return string

GetConfigSettingAsBool() public static method

public static GetConfigSettingAsBool ( string key ) : bool
key string
return bool

GetLogger() public static method

public static GetLogger ( string logName ) : log4net.ILog
logName string
return log4net.ILog

GetSection() public static method

public static GetSection ( string sectionName ) : object
sectionName string
return object

LoadCertificate() public static method

Attempts to load an X509 certificate from a Windows OS certificate store.
public static LoadCertificate ( StoreLocation storeLocation, string certificateSubject, bool checkValidity ) : X509Certificate2
storeLocation StoreLocation The certificate store to load from, can be CurrentUser or LocalMachine.
certificateSubject string The subject name of the certificate to attempt to load.
checkValidity bool Checks if the certificate is current and has a verifiable certificate issuer list. Should be /// set to false for self issued certificates.
return System.Security.Cryptography.X509Certificates.X509Certificate2

ToAbsoluteDirectoryPath() public static method

Checks whether a directory path represents a relative or absolute path and if it's relative converts it to an absolute one by prefixing it with the application's base directory.
public static ToAbsoluteDirectoryPath ( string directoryPath ) : string
directoryPath string The directory path to check.
return string

ToAbsoluteFilePath() public static method

Checks whether a file path represents a relative or absolute path and if it's relative converts it to an absolute one by prefixing it with the application's base directory.
public static ToAbsoluteFilePath ( string filePath ) : string
filePath string The file path to check.
return string

Property Details

CurrentDirectory public_oe static_oe property

public static string CurrentDirectory
return string

NewLine public_oe static_oe property

public static string NewLine
return string

logger public_oe static_oe property

public static ILog,log4net logger
return log4net.ILog