Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
        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);
            }

        }
Esempio n. 3
0
        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);
        }