Click or drag to resize
Program Class
The main Application class.
Inheritance Hierarchy

Namespace: OpenIIoT.Core
Assembly: OpenIIoT (in OpenIIoT.exe) Version:
public class Program

The Program type exposes the following members.

Private methodStatic memberProgram
Public methodProgram
Initializes a new instance of the Program class
Private propertyStatic memberInstallService
Gets or sets a value indicating whether the Windows Service should be installed.
Private propertyStatic memberLoggingLevel
Gets or sets the logging level for the application.
Private propertyStatic memberUninstallService
Gets or sets a value indicating whether the Windows Service should be uninstalled.
Protected methodStatic memberMain
Main entry point for the application.
Private methodStatic memberProcessArguments
Processes the command-line arguments passed to the application and performs the desired action(s).
Private methodStatic memberShutdown
Performs miscellaneous shutdown tasks.
Protected methodStatic memberStart
Entry point for the application logic.
Private methodStatic memberStartup
Performs miscellaneous startup tasks.
Protected methodStatic memberStop
Exit point for the application logic.
Private fieldStatic memberapplicationManager
The ApplicationManager for the application.
Private fieldStatic memberlogger
The main logger for the application.
Private fieldStatic membermanagers
The list of Managers for the application.
Extension Methods
Public Extension MethodToJson
Serializes and returns as json the specified object.
(Defined by Utility.)

Main(String) first processes command line arguments, reconfiguring the logger to the specified level and, if the -uninstall-service or -install-service arguments are specified, either installs or uninstalls the Windows Service for the application. If the Windows Service is modified, the application exits following the modification.

Next, the ApplicationManager is instantiated. Lastly, the application is started in either interactive or service mode, depending on how the application was started.

The application logic begins in Start(String), where the Application Manager is started, then the Startup method is invoked to execute miscellaneous post-startup tasks that weren't appropriate at a component level. Following the execution of Startup, ReadLine is invoked to run the application in perpetuity.

When the application is stopped, either by the enter key being pressed or by the service being stopped, the Stop method is invoked which invokes Shutdown to execute miscellaneous pre-stop tasks, then the ApplicationManager is stopped, which stops all managers and the application.

The field managers contains a list of the Manager Types for the application in the order in which they are to be instantiated and started.

See Also