Habanero.Base.HabaneroApp.Startup C# (CSharp) Method

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
        public virtual bool Startup()
        {
            IHabaneroLogger log = null;
            try {
                SetupApplicationNameAndVersion();
                SetupLogging();
                SetupExceptionNotifier();

                log = GlobalRegistry.LoggerFactory.GetLogger("HabaneroApp");
                LogAppStartingInfo(log);

                SetupDatabaseConnection();
                SetupSettings();
                SetupClassDefs();
                Upgrade();
            }
            catch (Exception ex) {
                string errorMessage = "There was a problem starting the application.";
                if (log != null)
                {
                    log.Log("---------------------------------------------" +
                              Environment.NewLine + ExceptionUtilities.GetExceptionString(ex, 0, true), LogCategory.Exception);
                    errorMessage += " Please look at the log file for details of the problem.";
                }
                if (GlobalRegistry.UIExceptionNotifier != null)
                {
                    GlobalRegistry.UIExceptionNotifier.Notify(
                        new UserException(errorMessage, ex),
                        "Problem in Startup:", "Problem in Startup");
                }
                return false;
            }
            return true;
        }