Ejemplo n.º 1
0
 /// <summary>
 /// Асинхронное включение/выключение компонента
 /// </summary>
 /// <param name="control"></param>
 /// <param name="enabled"></param>
 private void SetEnabled(Control control, bool enabled)
 {
     if (InvokeRequired)
     {
         SetEnabledCallback callback = new SetEnabledCallback(SetEnabled);
         this.Invoke(callback, new object[] { control, enabled });
     }
     else
     {
         control.Enabled = enabled;
     }
 }
Ejemplo n.º 2
0
 public void setEnabled(Boolean enabled)
 {
     if (this.InvokeRequired)
     {
         SetEnabledCallback d = new SetEnabledCallback(setEnabled);
         this.Invoke(d, new object[] { enabled });
     }
     else
     {
         this.Enabled = enabled;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Enabledスイッチのスレッドセーフ
 /// </summary>
 /// <param name="tar"></param>
 /// <param name="sw"></param>
 public void SetEnabled(Control tar, bool sw)
 {
     if (tar.InvokeRequired)
     {
         var d = new SetEnabledCallback(SetEnabled);
         tar.Invoke(d, new object[] { tar, sw });
     }
     else
     {
         tar.Enabled = sw;
     }
 }
Ejemplo n.º 4
0
 public static void Enabled(Form form, Control ctrl, bool bl)
 {
     if (ctrl.InvokeRequired)
     {
         SetEnabledCallback e = Enabled;
         form.Invoke(e, new object[] { form, ctrl, bl });
     }
     else
     {
         ctrl.Enabled = bl;
     }
 }
Ejemplo n.º 5
0
 private void SetEnabled(Control ctl, bool val)
 {
     if (ctl.InvokeRequired)
     {
         SetEnabledCallback d = new SetEnabledCallback(SetEnabled);
         Invoke(d, new object[] { ctl, val });
     }
     else
     {
         ctl.Enabled = val;
     }
 }
Ejemplo n.º 6
0
 private void SetEnabled(Control Control, bool Enabled)
 {
     if (Control.InvokeRequired)
     {
         var d = new SetEnabledCallback(SetEnabled);
         this.Invoke(d, Control, Enabled);
     }
     else
     {
         Control.Enabled = Enabled;
     }
 }
Ejemplo n.º 7
0
 private void setEnabled(Control c, bool b)
 {
     if (c.InvokeRequired)
     {
         SetEnabledCallback cb = new SetEnabledCallback(setEnabled);
         Invoke(cb, c, b);
     }
     else
     {
         c.Enabled = b;
     }
 }
 public void SetEnabled(Control ctrl, bool a)
 {
     if (ctrl.InvokeRequired)
     {
         SetEnabledCallback d = new SetEnabledCallback(SetEnabled);
         ctrl.Invoke(d, new object[] { ctrl, a });
     }
     else
     {
         ctrl.Enabled = a;
     }
 }
Ejemplo n.º 9
0
 public void setEnabled(Boolean enabled)
 {
     if (this.InvokeRequired)
     {
         SetEnabledCallback d = new SetEnabledCallback(setEnabled);
         this.Invoke(d, new object[] { enabled });
     }
     else
     {
         this.Enabled = enabled;
     }
 }
Ejemplo n.º 10
0
 private void SetEnable()
 {
     if (executeUpdates.InvokeRequired)
     {
         SetEnabledCallback callback = new SetEnabledCallback(SetEnable);
         this.Invoke(callback);
     }
     else
     {
         executeUpdates.Enabled = true;
     }
 }
Ejemplo n.º 11
0
 public static void EnableUI(bool isEnabled)
 {
     if (Program.mw.InvokeRequired)
     {
         SetEnabledCallback d = new SetEnabledCallback(EnableUI);
         Program.mw.tabControl1.Invoke(d, new object[] { isEnabled });
     }
     else
     {
         Program.mw.tabControl1.Enabled = isEnabled;
         Program.mw.ButtonStart.Enabled = isEnabled;
     }
 }
Ejemplo n.º 12
0
            public static void SetEnabled(Form form, string controlName, bool enabled)
            {
                Control ctrl = GetControlByName(form, controlName);

                if (ctrl.InvokeRequired)
                {
                    var d = new SetEnabledCallback(SetEnabled);
                    form.Invoke(d, form, ctrl, enabled);
                }
                else
                {
                    ctrl.Enabled = enabled;
                }
            }
Ejemplo n.º 13
0
 /// <summary>
 /// Set enabled property of various controls
 /// </summary>
 /// <param name="form">The calling form</param>
 /// <param name="ctrl"></param>
 /// <param name="enabled"></param>
 public static void SetEnabled(Form form, Control ctrl, bool enabled)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (ctrl.InvokeRequired)
     {
         SetEnabledCallback d = new SetEnabledCallback(SetEnabled);
         form.Invoke(d, new object[] { form, ctrl, enabled });
     }
     else
     {
         ctrl.Enabled = enabled;
     }
 }
Ejemplo n.º 14
0
 public void enableCloseButton(bool enable)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.progressBarProgressInformation.InvokeRequired)
     {
         SetEnabledCallback d = new SetEnabledCallback(enableCloseButton);
         this.Invoke(d, new object[] { enable });
     }
     else
     {
         this.buttonClose.Enabled = enable;
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Enables/Disables the button from being able to be pressed.
 /// </summary>
 /// <param name="shouldEnable">True if the button should be click-able, false otherwise.</param>
 private void EnableButton(bool shouldEnable)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.btnMain.InvokeRequired == true)
     {
         SetEnabledCallback theCallback = new SetEnabledCallback(EnableButton);
         this.Invoke(theCallback, new object[] { shouldEnable });
     }
     else
     {
         this.btnMain.Enabled = shouldEnable;
     }
 }
Ejemplo n.º 16
0
 private void SetEnabled(bool enabled)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (lstInstalledGames.InvokeRequired)
     {
         SetEnabledCallback d = SetEnabled;
         Invoke(d, enabled);
     }
     else
     {
         lstInstalledGames.Enabled = enabled;
     }
 }
 public void enableCloseButton(bool enable)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.progressBarProgressInformation.InvokeRequired)
     {
         SetEnabledCallback d = new SetEnabledCallback(enableCloseButton);
         this.Invoke(d, new object[] { enable });
     }
     else
     {
         this.buttonClose.Enabled = enable;
     }
 }
Ejemplo n.º 18
0
 private void DisableOrEnableControls(bool enable)
 {
     if (lblLoadAssembly.InvokeRequired)
     {
         SetEnabledCallback d = DisableOrEnableControls;
         Invoke(d, new object[] { enable });
     }
     else
     {
         lblCancel.Enabled             = !enable;
         lblLoadAssembly.Enabled       = enable;
         lblExecuteTestScripts.Enabled = enable;
         cmbxAttributes.Enabled        = enable;
         cmbxFilter.Enabled            = enable;
         lblExportExcel.Enabled        = enable;
         lblImportResults.Enabled      = enable;
     }
 }
Ejemplo n.º 19
0
 private void SetEnabled(Control Control, bool Enabled)
 {
     if (Control.InvokeRequired)
     {
         var d = new SetEnabledCallback(SetEnabled);
         this.Invoke(d, Control, Enabled);
     }
     else
     {
         Control.Enabled = Enabled;
     }
 }
Ejemplo n.º 20
0
 private void setButtonEnabled(bool en)
 {
     if (this._tboxError.InvokeRequired)
     {
         SetEnabledCallback d = new SetEnabledCallback(setButtonEnabled);
         this._startButton.Invoke(d, new object[] { en });
         //this._continueButton.Invoke(d, new object[] { en });
         //this._stopButton.Invoke(d, new object[] { !en });
     }
     else
     {
         this._startButton.Enabled = en;
         this._continueButton.Enabled = en;
         this._stopButton.Enabled = !en;
     }
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Provides a threadsafe way to update a control's enabled status
 /// </summary>
 /// <param name="c"></param>
 /// <param name="Enabled"></param>
 void SetEnabled(Control c, bool Enabled)
 {
     if (c.InvokeRequired)
     {
         SetEnabledCallback callback = new SetEnabledCallback(SetEnabled);
         this.Invoke(callback, new object[] { c, Enabled });
     }
     else
     {
         c.Enabled = Enabled;
     }
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Sets the enabled for asynchronous calls in a thread safe manner.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="enabled">The <paramref name="control"/> is set to 
 /// <paramref name="enabled"/>.</param>
 protected void SetEnabledSafe(Control control, bool enabled)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (control.InvokeRequired)
     {
         SetEnabledCallback d =
             new SetEnabledCallback(SetEnabledSafe);
         Invoke(d, new object[] {control, enabled});
     }
     else
     {
         control.Enabled = enabled;
     }
 }
Ejemplo n.º 23
0
        private void BlockInterface(bool value)
        {
            if (this.feedForwardRadioButton.InvokeRequired)
            {
                SetEnabledCallback d = new SetEnabledCallback(BlockInterface);
                this.Invoke(d, new object[] { value });
            }
            else
            {
                bool enabled = !value;
                this.feedForwardRadioButton.Enabled = enabled;
                this.kohonenRadioButton.Enabled = enabled;
                this.unipolarRadioButton.Enabled = enabled;
                this.biasCheckBox.Enabled = enabled;
                this.biPolarRadioButton.Enabled = enabled;
                this.inputNumberTextBox.Enabled = enabled;
                this.outputNumberTextBox.Enabled = enabled;
                this.momentumTextBox.Enabled = enabled;
                this.learningRateTextBox.Enabled = enabled;
                //this.layersNumberTextBox.Enabled = enabled;

                this.neuronNumberTextBox.Enabled = enabled;
                this.inputSizeTextBox.Enabled = enabled;
                this.loadProblemButton.Enabled = enabled;

                this.startButton.Enabled = enabled;
                this.stopButton.Enabled = !enabled;
            }
        }