C# Class Habanero.Base.HabaneroApp

The base class for a HabaneroAppUI and HabaneroAppConsole, two classes to kick start an application built using the Habanero libraries.
Show file Open project: Chillisoft/habanero

Protected Properties

Property Type Description
_applicationVersionUpgrader IApplicationVersionUpgrader

Public Methods

Method Description
HabaneroApp ( string appName, string appVersion ) : System

Constructor to initialise a new application with basic application information. Use the Startup() method to launch the application.

Startup ( ) : bool

Launches the application, initialising the logger, the database configuration and connection, the class definitions, the exception notifier and the synchronisation controller. This method also carries out any version upgrades using the IApplicationVersionUpgrader, if specified.

Protected Methods

Method Description
SetupApplicationNameAndVersion ( ) : void

Sets the GlobalRegistry ApplicationName and ApplicationVersion from AppName and AppVersion.

SetupClassDefs ( ) : void

Loads the class definitions

SetupDatabaseConnection ( ) : void

Sets up the database connection. If not provided, then reads the connection from the config file.

SetupExceptionNotifier ( ) : void

Sets up the exception notifier used to display exceptions to the final user. If not specified, assumes the FormExceptionNotifier.

SetupLogging ( ) : void

Sets up logging using Log4net. If you want to use your own logging component override this.

SetupSettings ( ) : void

Initialises the settings. If not provided, DatabaseSettings is assumed.

Upgrade ( ) : void

Upgrades an application's database where an application upgrader has been provided. See IApplicationVersionUpgrader.

Private Methods

Method Description
LogAppStartingInfo ( IHabaneroLogger log ) : void

Method Details

HabaneroApp() public method

Constructor to initialise a new application with basic application information. Use the Startup() method to launch the application.
public HabaneroApp ( string appName, string appVersion ) : System
appName string The application name
appVersion string The application version
return System

SetupApplicationNameAndVersion() protected method

Sets the GlobalRegistry ApplicationName and ApplicationVersion from AppName and AppVersion.
protected SetupApplicationNameAndVersion ( ) : void
return void

SetupClassDefs() protected abstract method

Loads the class definitions
protected abstract SetupClassDefs ( ) : void
return void

SetupDatabaseConnection() protected abstract method

Sets up the database connection. If not provided, then reads the connection from the config file.
protected abstract SetupDatabaseConnection ( ) : void
return void

SetupExceptionNotifier() protected abstract method

Sets up the exception notifier used to display exceptions to the final user. If not specified, assumes the FormExceptionNotifier.
protected abstract SetupExceptionNotifier ( ) : void
return void

SetupLogging() protected method

Sets up logging using Log4net. If you want to use your own logging component override this.
protected SetupLogging ( ) : void
return void

SetupSettings() protected abstract method

Initialises the settings. If not provided, DatabaseSettings is assumed.
protected abstract SetupSettings ( ) : void
return void

Startup() public method

Launches the application, initialising the logger, the database configuration and connection, the class definitions, the exception notifier and the synchronisation controller. This method also carries out any version upgrades using the IApplicationVersionUpgrader, if specified.
public Startup ( ) : bool
return bool

Upgrade() protected method

Upgrades an application's database where an application upgrader has been provided. See IApplicationVersionUpgrader.
protected Upgrade ( ) : void
return void

Property Details

_applicationVersionUpgrader protected property

The application version upgrader. Override this if you want to perform upgrade maneuvres on startup.
protected IApplicationVersionUpgrader _applicationVersionUpgrader
return IApplicationVersionUpgrader