Exemplo n.º 1
0
 private static void UiaClearText(BaseProdControl control)
 {
     if (ValuePatternHelper.GetIsReadOnly(control.UIAElement))
     {
         throw new ProdOperationException("Control is Read Only");
     }
     //currently the verification is done in pattern helper
     ValuePatternHelper.SetValue(control.UIAElement, "");
     LogController.ReceiveLogMessage(new LogMessage("Clear Text"));
 }
Exemplo n.º 2
0
        private static void UiaAppendText(BaseProdControl control, string newText)
        {
            if (ValuePatternHelper.GetIsReadOnly(control.UIAElement))
            {
                throw new ProdOperationException("Control is Read Only");
            }

            AutomationEventVerifier.Register(new EventRegistrationMessage(control, ValuePattern.ValueProperty));

            LogController.ReceiveLogMessage(new LogMessage("Appending: " + newText));
            ValuePatternHelper.AppendValue(control.UIAElement, newText);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Gets the read only state of the control.
 /// </summary>
 /// <param name="extension">The extension.</param>
 /// <param name="control">The control.</param>
 /// <returns>
 ///   <c>true</c> if in a ReadOnly state; otherwise, <c>false</c>.
 /// </returns>
 public static bool GetReadOnlyHook(this ValueAdapter extension, BaseProdControl control)
 {
     try
     {
         return(ValuePatternHelper.GetIsReadOnly(control.UIAElement));
     }
     catch (ArgumentNullException err)
     {
         throw new ProdOperationException(err);
     }
     catch (ElementNotAvailableException err)
     {
         throw new ProdOperationException(err);
     }
     catch (InvalidOperationException err)
     {
         //Note: Native
         throw new ProdOperationException(err);
     }
 }