Class Application
A class that represents an application built on the top of the framework. The class provides basic information about the application and methods for initializing and closing the application.
Inherited Members
Namespace: Juhta.Net.Startup
Assembly: Juhta.Net.Startup.dll
Syntax
public class Application : Singleton<Application>
Constructors
| Improve this Doc View SourceApplication()
Initializes a new instance.
Declaration
public Application()
Remarks
Log events will be written to the current user's temp directory, and the configuration files are assumed to locate in the binary directory.
Application(String)
Initializes a new instance.
Declaration
public Application(string logFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | logFilePath | Specifies a log file path. Can be null in which case the log file will be written
to the current user's temp directory. This default location will also be used if |
Remarks
The configuration files are assumed to locate in the binary directory.
Application(String, String)
Initializes a new instance.
Declaration
public Application(string logFilePath, string configDirectory)
Parameters
Type | Name | Description |
---|---|---|
System.String | logFilePath | Specifies a log file path. Can be null in which case the log file will be written
to the current user's temp directory. This default location will also be used if |
System.String | configDirectory | Specifies a directory to search for configuration files. Can be null in which case the configuration files are assumed to locate in the binary directory. |
Properties
| Improve this Doc View SourceBinDirectory
Gets the binary directory for the framework and application libraries. The return value is null if the application is not initialized.
Declaration
public string BinDirectory { get; }
Property Value
Type | Description |
---|---|
System.String |
ConfigDirectory
Gets the configuration directory for the framework and application libraries. The return value is null if the application is not initialized.
Declaration
public string ConfigDirectory { get; }
Property Value
Type | Description |
---|---|
System.String |
DefaultConfigFileName
Gets the name of the default configuration file for the application. Can be null.
Declaration
public string DefaultConfigFileName { get; }
Property Value
Type | Description |
---|---|
System.String |
IsInitialized
Returns true if the application has been initialized, otherwise false.
Declaration
public bool IsInitialized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
Gets the name of the application.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceClose()
Closes the application by closing all configured startup libraries.
Declaration
public void Close()
CloseInstance()
Closes the possibly created singleton Application instance.
Declaration
public static void CloseInstance()
GetDynamicLibraryContext<TDynamicLibrary, TLibraryState>()
Creates an instance of DynamicLibraryContext<TDynamicLibrary, TLibraryState> corresponding to specified dynamic library type and library state type.
Declaration
public DynamicLibraryContext<TDynamicLibrary, TLibraryState> GetDynamicLibraryContext<TDynamicLibrary, TLibraryState>()where TDynamicLibrary : IDynamicLibrary where TLibraryState : ILibraryState
Returns
Type | Description |
---|---|
DynamicLibraryContext<TDynamicLibrary, TLibraryState> | Returns the created DynamicLibraryContext<TDynamicLibrary, TLibraryState> instance. |
Type Parameters
Name | Description |
---|---|
TDynamicLibrary | Specifies a dynamic library type. |
TLibraryState | Specifies a library state type. |
Start()
Starts the application by initializing all configured startup libraries.
Declaration
public void Start()
StartInstance()
Creates and starts a new singleton Application instance.
Declaration
public static void StartInstance()
Remarks
Log events will be written to the current user's temp directory, and the configuration files are assumed to locate in the binary directory.
StartInstance(String)
Creates and starts a new singleton Application instance.
Declaration
public static void StartInstance(string logFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | logFilePath | Specifies a log file path. Can be null in which case the log file will be written
to the current user's temp directory. This default location will also be used if |
Remarks
The configuration files are assumed to locate in the binary directory.
StartInstance(String, String)
Creates and starts a new singleton Application instance.
Declaration
public static void StartInstance(string logFilePath, string configDirectory)
Parameters
Type | Name | Description |
---|---|---|
System.String | logFilePath | Specifies a log file path. Can be null in which case the log file will be written
to the current user's temp directory. This default location will also be used if |
System.String | configDirectory | Specifies a directory to search for configuration files. Can be null in which case the configuration files are assumed to locate in the binary directory. |