Ejemplo n.º 1
0
        private static void main(string[] args)
        {
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += unhandledException;
            Application.ThreadException += threadException;

            Dpi.Initialize();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            _kernel.Load <CoreModule>();
            _kernel.Load <DalModule>();
            _kernel.Load <DownloaderModule>();
            _kernel.Load <GuiModule>();

            var installer = _kernel.Get <Installer>();

            installer.MtgjsonFileUpdated += mtgjsonFileUpdated;
            installer.BeginInstall       += beginInstall;
            installer.EndInstall         += endInstall;

            _kernel.Get <PriceDownloader>().PricesDownloaded += pricesDownloaded;

            var loader = _kernel.Get <GuiLoader>();

            loader.Run();

            var formManager = _kernel.Get <FormManager>();

            formManager.MigrateHistoryFiles();
            formManager.CreateForm();

            Application.Run(formManager);

            loader.Abort();
        }