private void DaxStudioRibbon_Close(object sender, EventArgs e) { Log.Debug("{class} {method} {message}", "DaxStudioRibbon", "DaxStudioRibbon_Close", "Entering"); try { // stop the web host WebHost.Stop(); } catch (Exception ex) { Log.Error("{Class} {method} {exception} {stacktrace}", "DaxStudioRibbon", "DaxStudioRibbon_Close", ex.Message, ex.StackTrace); } Log.Debug("{class} {method} {message}", "DaxStudioRibbon", "DaxStudioRibbon_Close", "Exiting"); // TODO - need to find a way to only shut down the UI if // Dax Studio was launched from Excel // tell the DaxStudio.exe client to shutdown //if (_client != null) //{ // if (!_client.HasExited) // { // SetForegroundWindow(_client.MainWindowHandle); // _client.CloseMainWindow(); // } //} }
/// <summary> /// 停止 /// </summary> public void Stop() { try { webHost.Stop(); } catch (Exception ex) { throw new Exception("关闭SAEA.MVCServer失败 err:" + ex.Message); } }
public void Run() { var uri = "http://localhost:8080"; var host = new WebHost(uri); host.Run(); Console.WriteLine($"Service available at {uri}"); Console.WriteLine("Press <enter> to stop the service"); Console.ReadLine(); host.Stop(); }
/// <summary> /// 停止 /// </summary> public void Stop() { try { _webHost.Stop(); this.Running = false; } catch (Exception ex) { throw new Exception("关闭SAEAMvcApplication err:" + ex.Message); } }
internal void Stop() { _Server.Shutdown("Server is shutting down..."); NetworkComms.Shutdown(); _WebServer.Stop(); }
private void Application_Exit(object sender, ExitEventArgs e) { WebHost.Stop(); WebHost.Dispose(); }