Exemple #1
0
        private void LogInWindow_Load(object sender, EventArgs e)
        {
            if (!Connection.IsConnected())
            {
                Connection.ConnectToServer(stringIP, port);
            }

            if (Connection.IsConnected())
            {
                btnTryAgain.Visible     = false;
                labelConnecting.Visible = false;
                label1.Visible          = false;
                label2.Visible          = false;
                tbIP.Visible            = false;
                tbPort.Visible          = false;

                labelEmail.Visible    = true;
                labelPassword.Visible = true;
                tbEmail.Visible       = true;
                tbPassword.Visible    = true;
                btnLogIn.Visible      = true;
                btnSignUp.Visible     = true;
            }
            else
            {
                labelConnecting.Text = "Cannot connect to server!";
                btnTryAgain.Visible  = true;
                label1.Visible       = true;
                label2.Visible       = true;
                tbIP.Visible         = true;
                tbPort.Visible       = true;
            }
        }
Exemple #2
0
        private void btnTryAgain_Click(object sender, EventArgs e)
        {
            Connection.ConnectToServer(tbIP.Text, int.Parse(tbPort.Text));

            if (Connection.IsConnected())
            {
                btnTryAgain.Visible     = false;
                labelConnecting.Visible = false;
                label1.Visible          = false;
                label2.Visible          = false;
                tbIP.Visible            = false;
                tbPort.Visible          = false;

                labelEmail.Visible    = true;
                labelPassword.Visible = true;
                tbEmail.Visible       = true;
                tbPassword.Visible    = true;
                btnLogIn.Visible      = true;
                btnSignUp.Visible     = true;
            }
        }