// 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;
     }
 }
示例#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;
     }
 }
示例#3
0
        private void BloquearDesbloquearBotoesDeDownload(bool acao)
        {
            var btnDelegade = new SetBtnCallback(DesabilitarOuHabilitarBotoes);

            this.Invoke(btnDelegade, new object[]
            {
                new List <Button>
                {
                    btnDevDownload,
                    btnHomologDownload,
                    btnProdDownload
                },
                acao
            });
        }
示例#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;
     }
 }