Example #1
0
        public static bool TryDoDefaultAction(this AutomationElement el)
        {
            if (!el.Current.IsEnabled)
            {
                return(false);
            }
            object invoke;

            if (el.TryGetCurrentPattern(InvokePattern.Pattern, out invoke))
            {
                ((InvokePattern)invoke).Invoke();
                return(true);
            }

            object legacyPattern;

            if (el.TryGetCurrentPattern(LegacyIAccessiblePattern.Pattern, out legacyPattern))
            {
                LegacyIAccessiblePattern legacy = (LegacyIAccessiblePattern)legacyPattern;
                if (legacy.Current.DefaultAction != "")
                {
                    legacy.DoDefaultAction();
                }
                return(true);
            }

            return(false);
        }
Example #2
0
 internal LegacyIAccessiblePatternInformation(LegacyIAccessiblePattern pattern, bool cache)
 {
     this.pattern = pattern;
     this.cache   = cache;
 }
 public LegacyIAccessiblePatternDescriptorObj(LegacyIAccessiblePattern pattern)
 {
     _pattern = pattern;
 }