Ejemplo n.º 1
0
 private void handleControls()
 {
     try
     {
         if (this.InvokeRequired)
         {
             threadCallBack c = new threadCallBack(handleControls);
             this.Invoke(c);
         }
         else
         {
             circularProgress.IsRunning = !circularProgress.IsRunning;
             loginControl.buttonIngresar.Enabled = !loginControl.buttonIngresar.Enabled;
             loginControl.textBoxUsuario.Enabled = !loginControl.textBoxUsuario.Enabled;
             loginControl.textBoxPassword.Enabled = !loginControl.textBoxPassword.Enabled;
         }
     }
     catch (ObjectDisposedException ex)
     {
     }
 }
Ejemplo n.º 2
0
 void handleControlsEnabled()
 {
     if (this.txtUser.InvokeRequired)
     {
         threadCallBack c = new threadCallBack(handleControlsEnabled);
         this.Invoke(c);
     }
     else
     {
         this.txtUser.Enabled = !this.txtUser.Enabled;
         if (this.txtPassword.InvokeRequired)
         {
             threadCallBack c = new threadCallBack(handleControlsEnabled);
             this.Invoke(c);
         }
         else
         {
             this.txtPassword.Enabled = !this.txtPassword.Enabled;
             if (this.btnIngresar.InvokeRequired)
             {
                 threadCallBack c = new threadCallBack(handleControlsEnabled);
                 this.Invoke(c);
             }
             else
             {
                 this.btnIngresar.Enabled = !this.btnIngresar.Enabled;
                 if (this.btnCancelar.InvokeRequired)
                 {
                     threadCallBack c = new threadCallBack(handleControlsEnabled);
                     this.Invoke(c);
                 }
                 else
                 {
                     this.btnCancelar.Enabled = !this.btnCancelar.Enabled;
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 private void showEnvironment()
 {
     if (this.InvokeRequired)
     {
         threadCallBack c = new threadCallBack(showEnvironment);
         this.Invoke(c);
     }
     else
     {
         this.Hide();
         Entorno entorno = new Entorno(usuario);
         entorno.ShowDialog();
         Application.Exit();
     }
 }
Ejemplo n.º 4
0
 void handleProgressBar()
 {
     if (this.cpbConectando.InvokeRequired)
     {
         threadCallBack c = new threadCallBack(handleProgressBar);
         this.Invoke(c);
     }
     else
     {
         cpbConectando.IsRunning = !cpbConectando.IsRunning;
     }
 }
Ejemplo n.º 5
0
 void selectTxtUser()
 {
     if (this.txtUser.InvokeRequired)
     {
         threadCallBack c = new threadCallBack(selectTxtUser);
         this.Invoke(c);
     }
     else
     {
         this.txtUser.Focus();
         this.txtUser.SelectAll();
     }
 }
Ejemplo n.º 6
0
 void ocultarLogin()
 {
     if (this.InvokeRequired)
     {
         threadCallBack c = new threadCallBack(ocultarLogin);
         this.Invoke(c);
     }
     else
     {
         this.Hide();
     }
 }