//------------------------------------------------------ // // Public Methods // //------------------------------------------------------ #region Public Methods /// <summary> /// Request to set the value that this UI element is representing /// </summary> /// <param name="value">Value to set the UI to, as a double</param> public void SetValue(double value) { // Test the Enabled state prior to the more general Read-Only state. object enabled = _el.GetCurrentPropertyValue(AutomationElementIdentifiers.IsEnabledProperty); if (enabled is bool && !(bool)enabled) { throw new ElementNotEnabledException(); } // Test the Read-Only state after the more specific Enabled state. object readOnly = _el.GetCurrentPropertyValue(IsReadOnlyProperty); if (readOnly is bool && (bool)readOnly) { throw new InvalidOperationException(SR.Get(SRID.ValueReadonly)); } UiaCoreApi.RangeValuePattern_SetValue(_hPattern, value); }