コード例 #1
0
ファイル: Program.cs プロジェクト: RJefferys/Hypertoken
        private static void Main()
        {
            //try
            //{
            LogManager.ThrowExceptions = true;

            Log.Debug("Initialize BugSense");
            BugSense.Init("9eacbe2e", GetVersion(), "http://www.bugsense.com/api/errors");
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;

            Log.Debug("Initializing advanced JIT");
            AdvancedJIT.SetupJIT();

            Log.Debug("Building IOC container");
            ContainerSetup containerSetup = new ContainerSetup();
            var container = containerSetup.BuildWinFormsContainer();
            //var container = containerSetup.BuildAvalonContainer();

            Log.Debug("Running ITerminal");
            if (container.IsRegistered<InitableRunner>())
                container.Resolve<InitableRunner>().Init();
            container.Resolve<TerminalRunner>().Run();

            //}
            //catch (Exception e)
            //{
            //	Log.Fatal(e.Message);
            //	BugSense.SendException(e);
            //	MessageBox.Show(e.Message, "Unhandled exception");
            //}
        }
コード例 #2
0
        private static void Main()
        {
            //try
            //{

            Task.Factory.StartNew(() =>
            {
                NLog.LogManager.ThrowExceptions = true;

                LogTo.Debug("Initialize BugSense");
                BugSense.Init("9eacbe2e", GetVersion(), "http://www.bugsense.com/api/errors");
                AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;

                LogTo.Debug("Initializing advanced JIT");
                AdvancedJIT.SetupJIT();
            });

            LogTo.Debug("Building IOC container");
            ContainerSetup containerSetup = new ContainerSetup();
            var            container      = containerSetup.BuildWinFormsContainer();

            //var container = containerSetup.BuildAvalonContainer();

            LogTo.Debug("Running ITerminal");
            if (container.IsRegistered <InitableRunner>())
            {
                container.Resolve <InitableRunner>().Init();
            }
            container.Resolve <ITerminal>().Run();

            //}
            //catch (Exception e)
            //{
            //	LogTo.Fatal(e.Message);
            //	BugSense.SendException(e);
            //	MessageBox.Show(e.Message, "Unhandled exception");
            //}
        }