Пример #1
0
 private void SetLoader2Visiblity(bool state)
 {
     if (this.loaderIndicator.InvokeRequired)
     {
         SetBoolDelegate d = new SetBoolDelegate(SetLoader2Visiblity);
         this.Invoke(d, new object[] { state });
     }
     else
     {
         this.loaderIndicator.Visible = state;
     }
 }
Пример #2
0
 private void SetBrowserLoadingOverlayVisiblity(bool state)
 {
     if (this.browserLoadingOverlay.InvokeRequired)
     {
         SetBoolDelegate d = new SetBoolDelegate(SetBrowserLoadingOverlayVisiblity);
         this.Invoke(d, new object[] { state });
     }
     else
     {
         this.browserLoadingOverlay.Visible = state;
     }
 }
Пример #3
0
 public static void SetEnabled(Control ctrl, bool enabled)
 {
     if (ctrl.InvokeRequired)
     {
         SetBoolDelegate del = new SetBoolDelegate(CrossThreadUI.SetEnabled);
         if (CrossThreadUI.ExecSync)
         {
             ctrl.Invoke(del, ctrl, enabled);
         }
         else
         {
             ctrl.BeginInvoke(del, ctrl, enabled);
         }
     }
     else
     {
         ctrl.Enabled = enabled;
     }
 }
Пример #4
0
 public static void SetVisible(Control ctrl, bool visible)
 {
     if (ctrl.InvokeRequired)
     {
         SetBoolDelegate del = new SetBoolDelegate(CrossThreadUI.SetVisible);
         if (CrossThreadUI.ExecSync)
         {
             ctrl.Invoke(del, ctrl, visible);
         }
         else
         {
             ctrl.BeginInvoke(del, ctrl, visible);
         }
     }
     else
     {
         ctrl.Visible = visible;
     }
 }
Пример #5
0
 /// <summary>
 /// Sets the 'Enabled' property of a given control.
 /// </summary>
 /// <param name="ctrl">The System.Windows.Forms.Control object whose enabled property will be set.</param>
 /// <param name="enabled">The System.Boolean value to assign to the property.</param>
 public static void SetEnabled(Control ctrl, bool enabled)
 {
     if (ctrl.InvokeRequired)
     {
         SetBoolDelegate del = new SetBoolDelegate(CrossThreadUI.SetEnabled);
         if (CrossThreadUI.ExecSync)
             ctrl.Invoke(del, ctrl, enabled);
         else
             ctrl.BeginInvoke(del, ctrl, enabled);
     }
     else
         ctrl.Enabled = enabled;
 }
Пример #6
0
 /// <summary>
 /// Sets the 'Visible' property of a given control.
 /// </summary>
 /// <param name="ctrl">The System.Windows.Forms.Control object whose visible property will be set.</param>
 /// <param name="visible">The System.Boolean value to assign to the property.</param>
 public static void SetVisible(Control ctrl, bool visible)
 {
     if (ctrl.InvokeRequired)
     {
         SetBoolDelegate del = new SetBoolDelegate(CrossThreadUI.SetVisible);
         if (CrossThreadUI.ExecSync)
             ctrl.Invoke(del, ctrl, visible);
         else
             ctrl.BeginInvoke(del, ctrl, visible);
     }
     else
         ctrl.Visible = visible;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="path">path is "form-name/label-text"</param>
 /// <param name="getValue">lambda expression to get value</param>
 /// <param name="setValue">lambda expression to set value</param>
 public InputBool(string path, GetBoolDelegate getValue, SetBoolDelegate setValue)
     : base(path, () => getValue().ToString(), (val) => setValue(Convert.ToBoolean(val)))
 {
 }