// To access the button enabled property in a thread safe manner
 public void SetBtn(Control ctrl, bool a)
 {
     if (ctrl.InvokeRequired)
     {
         SetBtnCallback d = new SetBtnCallback(SetBtn);
         ctrl.Invoke(d, new object[] { ctrl, a });
     }
     else
     {
         ctrl.Enabled = a;
     }
 }
Ejemplo n.º 2
0
 private void ButtonsSet(bool a, bool b, bool c)
 {
     if (this.StartBtn.InvokeRequired || this.CancelBtn.InvokeRequired || this.BrowseBtn.InvokeRequired)
     {
         SetBtnCallback d = new SetBtnCallback(ButtonsSet);
         this.Invoke(d, new object[] { a, b, c });
     }
     else
     {
         StartBtn.Enabled  = a;
         BrowseBtn.Enabled = b;
         CancelBtn.Enabled = c;
     }
 }
Ejemplo n.º 3
0
        private void BloquearDesbloquearBotoesDeDownload(bool acao)
        {
            var btnDelegade = new SetBtnCallback(DesabilitarOuHabilitarBotoes);

            this.Invoke(btnDelegade, new object[]
            {
                new List <Button>
                {
                    btnDevDownload,
                    btnHomologDownload,
                    btnProdDownload
                },
                acao
            });
        }
Ejemplo n.º 4
0
 private void ButtonsSet(bool a, bool b, bool c)
 {
     if (this.StartBtn.InvokeRequired || this.CancelBtn.InvokeRequired || this.BrowseBtn.InvokeRequired)
     {
         SetBtnCallback d = new SetBtnCallback(ButtonsSet);
         this.Invoke(d, new object[] { a, b, c });
     }
     else
     {
         StartBtn.Enabled = a;
         BrowseBtn.Enabled = b;
         CancelBtn.Enabled = c;
     }
 }