private void CreateChatConnection() { lock (chatConnectionLock) { Program.Log.Info("Enter CreateChatConnection"); while (!closed && !chatConnection.IsConnected) { #if !DEBUG if (WindowsService.GetServiceStatus("AutoExporterSvc") == ServiceControllerStatus.Running) #endif chatConnection.Connect(CurrentUser); Thread.Sleep(5000); } Program.Log.Info("Exit CreateChatConnection"); if (chatConnection.IsConnected) { serviceManager.SetStatus(ServiceControllerStatus.Running); Program.Log.Warn("1"); viewManager.OnStatusChange(this, new EventArgs()); } } }