public ServiceStarter() { Console.WriteLine("\nEnter ServiceStarter ctor\n"); #region Use SQLite using (DB db = new DB("OpenALPRQueueMilestone", true)) { settings = db.GetSettings(); } Console.WriteLine("\nDB setup exit\n"); ProxySingleton.Port = settings.ServicePort.ToString(); #endregion currentPerson = new User(User.AutoExporterServiceName); ProxySingleton.HostName = Dns.GetHostName(); Chatting.Initialize(currentPerson); Chatting.UserEnter += ServerConnection_UserEnter; Chatting.UserLeave += ServerConnection_UserLeave; Chatting.InfoArrived += ServerConnection_MessageArrived; Task.Run(() => Chatting.MonitorClientToServerQueue()); Chatting.WhisperGui(new Info { MsgId = MessageId.ConnectedToMilestoneServer, Bool = true }); Console.WriteLine("\nExit ServiceStarter ctor\n"); }
private void CreateChat() { chatConnection = new Chatting(); chatConnection.Initialize(); chatConnection.InfoReceived += InfoReceived; chatConnection.InfoWhispreReceived += InfoWhispreReceived; chatConnection.UserEnter += UserEnter; chatConnection.UserLeave += UserLeft; Task.Run(() => CreateChatConnection()); }