Beispiel #1
0
 /// <summary>
 /// Checks if the given pattern is available for the element via properties
 /// </summary>
 public bool IsPatternSupported(PatternId pattern)
 {
     if (Equals(pattern, PatternId.NotSupportedByFramework))
     {
         return false;
     }
     if (pattern.AvailabilityProperty == null)
     {
         throw new ArgumentException("Pattern doesn't have an AvailabilityProperty");
     }
     var success = FrameworkAutomationElement.TryGetPropertyValue(pattern.AvailabilityProperty, out bool isPatternAvailable);
     return success && isPatternAvailable;
 }
Beispiel #2
0
 /// <inheritdoc />
 public bool TryGetValue(out TVal value)
 {
     return(FrameworkAutomationElement.TryGetPropertyValue(PropertyId, out value));
 }