/// <summary> /// Updates the <see cref="textblock_listening_port"/> and <see cref="combobox_listening_report"/>. /// Set the state of these two object to reflect the connection state of the <see cref="Messenger"/>. /// </summary> /// <param name="connected">True if the client app is connected.</param> private void UpdateListenerDescription(bool connected) { if (label_artistname_trackname.InvokeRequired) { // thread-safe callback SetBoolCallback d = new SetBoolCallback(UpdateListenerDescription); this.Invoke(d, new object[] { connected }); } else { if (!connected) { string[] listeningAddresses = messenger.GetPossibleIPAddresses(); textblock_listening_port.Text = form_main.LISTENING_FOR_CONNECTION; combobox_listening_port.DataSource = listeningAddresses; combobox_listening_port.SelectedIndex = 0; combobox_listening_port.Show(); } else { textblock_listening_port.Text = form_main.CONNECTION_ESTABLISHED; combobox_listening_port.Hide(); } } }
public void btn_autoStopModeOnEnable(bool enable) { if (this.btn_AutoStopModeOn.InvokeRequired) { SetBoolCallback dp = new SetBoolCallback(btn_autoStopModeOnEnable); this.Invoke(dp, new object[] { enable }); } else { btn_AutoStopModeOn.Enabled = enable; } }
/// <summary> /// safely access enabled element of back button /// </summary> /// <param name="inputEnabled"></param> private void SetBtnBackEnabled(bool inputEnabled) { if (InvokeRequired) { SetBoolCallback d = new SetBoolCallback(SetBtnBackEnabled); this.Invoke(d, new object[] { inputEnabled }); } else { btnBack.Enabled = inputEnabled; } }
private void ChangeCheckOnList(CheckedListBox clb, int index, bool value) { if (clb.InvokeRequired) { var sbc = new SetBoolCallback(ChangeCheckOnList); Invoke(sbc, clb, index, value); } else { clb.SetItemChecked(index, !value); } }
private void SetBool(Control obj, bool value) { if (obj.InvokeRequired) { SetBoolCallback tcb = new SetBoolCallback(SetBool); this.Invoke(tcb, new Object[] { obj, value }); } else { obj.Enabled = value; } }
private void SetProgressbar(bool on) { if (ProgressBar.Dispatcher.CheckAccess()) { ProgressBar.Visibility = on ? Visibility.Visible : Visibility.Hidden; } else { SetBoolCallback d = new SetBoolCallback(SetProgressbar); ProgressBar.Dispatcher.Invoke(d, new object[] { on }); } }
private void SetbtnStart(bool b) { if (this.buttonStart.InvokeRequired) { SetBoolCallback d = new SetBoolCallback(SetbtnStart); this.Invoke(d, new object[] { b }); } else { this.buttonStart.Enabled = b; } }
private void ButtonEnable(bool en) { if (lsvLog.InvokeRequired) { SetBoolCallback e = new SetBoolCallback(ButtonStatus); Invoke(e, new object[] { en }); } else { btnConfirm.Enabled = en; } }
public void btn_SettingsEnable(bool enable) { if (this.btn_setting.InvokeRequired) { SetBoolCallback dp = new SetBoolCallback(btn_SettingsEnable); this.Invoke(dp, new object[] { enable }); } else { btn_setting.Enabled = enable; } }
public void btn_barcodeOffEnable(bool enable) { if (this.btn_BarcodeReadOff.InvokeRequired) { SetBoolCallback dp = new SetBoolCallback(btn_barcodeOffEnable); this.Invoke(dp, new object[] { enable }); } else { btn_BarcodeReadOff.Enabled = enable; } }
/// <summary> /// Only the Start or Stop button should be enabled at 1 time /// </summary> /// <param name="value"></param> private void ToggleStartButtonEnable(bool value) { if (this.buttonStart.InvokeRequired || this.buttonStop.InvokeRequired) { SetBoolCallback d = new SetBoolCallback(ToggleStartButtonEnable); this.Invoke(d, new object[] { value }); } else { buttonStop.Enabled = !value; buttonStart.Enabled = value; } }
public static void SetVisible(Control Control, bool Visible = true) { try { if (Control.InvokeRequired) { var Callback = new SetBoolCallback(SetVisible); Control.Invoke(Callback, Control, Visible); } else { Control.Visible = Visible; } } catch { } }
internal static void SetEnabled(Control Control, bool Enabled = true) { try { if (Control.InvokeRequired) { var Callback = new SetBoolCallback(SetEnabled); Control.Invoke(Callback, Control, Enabled); } else { Control.Visible = Enabled; } } catch { } }
//가용 버튼 등 설정을 위한 메서드 private void SetBtn(int val) { if (this.btn_cnt.InvokeRequired) { SetBoolCallback d = new SetBoolCallback(SetBtn); this.Invoke(d, new object[] { val }); } else { switch (val) { case 0: { checkBox1.Enabled = false; btn_dcnt.Enabled = false; btn_cnt.Enabled = true; checkBox1.Checked = false; voiceFlag = false; break; } case 1: { btn_cnt.Enabled = false; btn_dcnt.Enabled = true; checkBox1.Enabled = true; break; } case 2: { checkBox1.Enabled = false; voiceFlag = true; break; } case 3: { checkBox1.Enabled = true; voiceFlag = false; break; } } } }
public void UpdateBacklight(bool enabled) { if (this.audioCheckBox.InvokeRequired) { SetBoolCallback d = new SetBoolCallback(UpdateBacklight); this.Invoke(d, new object[] { enabled }); } else { backlightCheckBox.Enabled = true; if (enabled) { backlightCheckBox.Checked = true; } else { backlightCheckBox.Checked = false; } } }
private void MostrarStatusSobreAquecimento() { SetTextCallback textCallBack; SetBoolCallback boolCallBack; for (int i = MicroOndas.Instance.funcao.tempo; i >= 0; i--) { Application.DoEvents(); textCallBack = new SetTextCallback(setStatusAquecimentoDisplay); this.Invoke(textCallBack, new object[] { "Aquecimento " + MicroOndas.Instance.funcao.nome + new string(MicroOndas.Instance.funcao.caracter, ((MicroOndas.Instance.funcao.tempo - i) * MicroOndas.Instance.funcao.potencia) % 40) }); textCallBack = new SetTextCallback(setTempoDisplay); this.Invoke(textCallBack, new object[] { i.ToString() }); Thread.Sleep(1000); } SystemSounds.Beep.Play(); textCallBack = new SetTextCallback(setStatusAquecimentoDisplay); this.Invoke(textCallBack, new object[] { "Aquecida" }); boolCallBack = new SetBoolCallback(setEnableBotoes); this.Invoke(boolCallBack, new object[] { false }); task = null; }
public void UpdateRGBLight(bool enabled) { if (this.audioCheckBox.InvokeRequired) { SetBoolCallback d = new SetBoolCallback(UpdateRGBLight); this.Invoke(d, new object[] { enabled }); } else { colorButton.Enabled = true; label22.Enabled = true; label31.Enabled = true; RGBLightCheckBox.Enabled = true; if (enabled) { RGBLightCheckBox.Checked = true; } else { RGBLightCheckBox.Checked = false; } } }
private void SpinnerEnabled(bool b) { if (pictureBox1.InvokeRequired) { SetBoolCallback callback = new SetBoolCallback(SpinnerEnabled); this.Invoke(callback, new object[] { b }); } else pictureBox1.Visible = b; }
private void ComenzarEnabled(bool b) { if (button1.InvokeRequired) { SetBoolCallback callback = new SetBoolCallback(ComenzarEnabled); this.Invoke(callback, new object[] { b }); } else button1.Enabled = b; }
private void UpdatePanelAnalisis(bool s) { if (this.panelAnalisisEscenas.InvokeRequired) { SetBoolCallback d = new SetBoolCallback(UpdatePanelAnalisis); this.Invoke(d, new object[] { s }); } else { panelAnalisisEscenas.Visible = s; } }
private void UpdateKeyFrameList(bool s) { if (this.InvokeRequired) { SetBoolCallback d = new SetBoolCallback(UpdateKeyFrameList); this.Invoke(d, new object[] { s }); } else { if (s) keyFrameBox.BackgroundImage = null; KeyframesAvailable = s; } }