Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public App()
 {
     exceptionHandler = null;
     eventBus         = null;
     logger           = null;
     configurator     = null;
     communicator     = null;
     controller       = null;
     main             = null;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Boot components
        /// </summary>
        private void Boot()
        {
            // Exception handler
            exceptionHandler = new ExceptionHandler();

            // Logger
            logger = new FileLogger("log_" + DateTime.Now.ToString("yy-MM-dd") + ".txt");
            logger.Debug("Logger loaded.");

            // Logger now ready --> give to ExceptionHandler
            exceptionHandler.SetLogger(logger);

            // Configurator
            configurator = new Configurator();
            configurator.Init();
            logger.Debug("Configurator loaded.");

            // Communicator
            communicator = new Communicator(configurator.Port, logger);
            communicator.Init();
            logger.Debug("Communicator loaded.");

            // Controller
            controller = new Controller(logger, communicator);
            logger.Debug("Controller loaded.");

            // Event Bus
            eventBus = new EventBus(this, main, communicator, controller);

            // Main window
            main = new Forms.Main(eventBus, configurator);
            main.Init();

            // Main now ready --> give to Event bus
            eventBus.SetMain(main);
        }