Пример #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            InitializeLogger();
            SetupExceptionHandling();
            base.OnStartup(e);
            _bootstrapper = new Bootstrapper();
            _bootstrapper.Run(true);

            _webServer = WebserverFactory.CreateWebServer(_bootstrapper.Container, "http://localhost:1337");
            _webServer.RunAsync();
        }
Пример #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            Process currentProcess = Process.GetCurrentProcess();

            if (Process.GetProcesses().Any(p => p.ProcessName == currentProcess.ProcessName && p.Id != currentProcess.Id))
            {
                _isSingleInstance = false;
                MessageBox.Show("Already an instance running...");
                Current.Shutdown();
            }
            else
            {
                InitializeLogger();
                SetupExceptionHandling();
                base.OnStartup(e);
                _bootstrapper = new Bootstrapper();
                _bootstrapper.Run(true);

                _webServer = WebserverFactory.CreateWebServer(_bootstrapper.Container, "http://localhost:1337");
                _webServer.RunAsync();
            }
        }