public bool TryGetCurrentPattern(AutomationPattern pattern, out object patternObject) { Validate.ArgumentNotNull(parameter: pattern, parameterName: nameof(pattern)); var currentPattern = IUIAutomationElement.GetCurrentPattern(patternId: pattern.Id); if (currentPattern == null) { patternObject = null; return(false); } patternObject = pattern.Wrap(element: this, pattern: currentPattern); return(true); }
public object GetCurrentPattern(AutomationPattern pattern) { Validate.ArgumentNotNull(parameter: pattern, parameterName: nameof(pattern)); return(pattern.Wrap(element: this, pattern: IUIAutomationElement.GetCurrentPattern(patternId: pattern.Id))); }