Example #1
0
        public void RestartValidation()
        {
            NameWindow nameWindow = new NameWindow();

            if (nameWindow.ShowDialog() == true)
            {
                var typle = nameWindow.GetNamePass();

                chatClient.UserName = typle.Item1;
                chatClient.Password = typle.Item2;

                Title = " {" + typle.Item1 + '}';
            }
            else
            {
                Close();
            }
        }
Example #2
0
        private void SetName()
        {
            NameWindow nameWindow = new NameWindow();

            if (nameWindow.ShowDialog() == true)
            {
                var typle = nameWindow.GetNamePass();

                chatClient = new Client(typle.Item1, typle.Item2, "127.0.0.1", 8888, this);

                Title = " {" + typle.Item1 + '}';

                Thread clientThread = new Thread(chatClient.Connect);
                clientThread.Start();
            }
            else
            {
                Close();
            }
        }