/** * <summary> * Registers the callback function that is invoked on every change of advertised value. * <para> * The callback is invoked only during the execution of <c>ySleep</c> or <c>yHandleEvents</c>. * This provides control over the time when the callback is triggered. For good responsiveness, remember to call * one of these two functions periodically. To unregister a callback, pass a null pointer as argument. * </para> * <para> * </para> * </summary> * <param name="callback"> * the callback function to call, or a null pointer. The callback function should take two * arguments: the function object of which the value has changed, and the character string describing * the new advertised value. * @noreturn * </param> */ public int registerValueCallback(ValueCallback callback) { string val; if (callback != null) { YFunction._UpdateValueCallbackList(this, true); } else { YFunction._UpdateValueCallbackList(this, false); } this._valueCallbackTemperature = callback; // Immediately invoke value callback with current value if (callback != null && this.isOnline()) { val = this._advertisedValue; if (!(val == "")) { this._invokeValueCallback(val); } } return(0); }
/** * <summary> * Registers the callback function that is invoked on every change of advertised value. * <para> * The callback is invoked only during the execution of <c>ySleep</c> or <c>yHandleEvents</c>. * This provides control over the time when the callback is triggered. For good responsiveness, remember to call * one of these two functions periodically. To unregister a callback, pass a null pointer as argument. * </para> * <para> * </para> * </summary> * <param name="callback"> * the callback function to call, or a null pointer. The callback function should take two * arguments: the function object of which the value has changed, and the character string describing * the new advertised value. * @noreturn * </param> */ public async Task <int> registerValueCallback(ValueCallback callback) { string val; if (callback != null) { await YFunction._UpdateValueCallbackList(this, true); } else { await YFunction._UpdateValueCallbackList(this, false); } _valueCallbackMultiAxisController = callback; // Immediately invoke value callback with current value if (callback != null && await this.isOnline()) { val = _advertisedValue; if (!(val == "")) { await this._invokeValueCallback(val); } } return(0); }
/** * <summary> * Registers the callback function that is invoked on every change of advertised value. * <para> * The callback is invoked only during the execution of <c>ySleep</c> or <c>yHandleEvents</c>. * This provides control over the time when the callback is triggered. For good responsiveness, remember to call * one of these two functions periodically. To unregister a callback, pass a null pointer as argument. * </para> * <para> * </para> * </summary> * <param name="callback"> * the callback function to call, or a null pointer. The callback function should take two * arguments: the function object of which the value has changed, and the character string describing * the new advertised value. * @noreturn * </param> */ public int registerValueCallback(ValueCallback callback) { string val; if (callback != null) { YFunction._UpdateValueCallbackList(this, true); } else { YFunction._UpdateValueCallbackList(this, false); } this._valueCallbackDigitalIO = callback; // Immediately invoke value callback with current value if (callback != null && this.isOnline()) { val = this._advertisedValue; if (!(val == "")) { this._invokeValueCallback(val); } } return 0; }
public virtual void openFileChooser(ValueCallback<Uri> uploadMsg) { }
public virtual void openFileChooser(ValueCallback <Uri> uploadMsg) { }
internal void ShowCombo <D>(ComboBox combo, List <D> items, TextCallback <D> text, ValueCallback <D> value, int selectedIndex) { combo.Items.Clear(); var data = new List <dynamic>(); items.ForEach((item) => data.Add(new { Text = text(item), Value = value(item) })); combo.DataSource = data; }