public void show() { if (!this.showChat) { this.tokenSource = new CancellationTokenSource(); var token = tokenSource.Token; this.chat = new ChatWindow(this.nick, this.loginNick, this.serwer, this.allMessages, this, tokenSource); this.showChat = true; var t = Task.Run(() => { Application.Run(this.chat); }, token); } }
public void showAndMessage(string time, string message) { if (!this.showChat) { this.tokenSource = new CancellationTokenSource(); var token = tokenSource.Token; this.allMessages += this.nick + " " + time + "\n" + message + " \n\n\n"; this.chat = new ChatWindow(this.nick, this.loginNick, this.serwer, this.allMessages, this, tokenSource); this.showChat = true; var t = Task.Run(() => { Application.Run(this.chat); }, token); } }
public User(string nick, string loginNick, Serwer serwer) { this.nick = nick; this.serwer = serwer; this.loginNick = loginNick; this.tokenSource = new CancellationTokenSource(); var token = this.tokenSource.Token; this.chat = new ChatWindow(this.nick, this.loginNick, this.serwer, this.allMessages, this, tokenSource); this.showChat = true; var t = Task.Run(() => { Application.Run(this.chat); }, token); }