System.Windows.Automation.AutomationElement.GetCachedPattern C# (CSharp) Method

GetCachedPattern() public method

public GetCachedPattern ( AutomationPattern pattern ) : object
pattern AutomationPattern
return object
        public object GetCachedPattern(AutomationPattern pattern)
        {
            object patternObj;
            if (!this.TryGetCachedPattern(pattern, out patternObj))
            {
                throw new InvalidOperationException("Unsupported pattern");
            }
            return patternObj;
        }

Usage Example

Example #1
0
        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        internal object GetPattern(AutomationElement element, bool m_useCurrent, AutomationPattern pattern)
        {

            object patternObj = null;

            if (m_useCurrent)
                patternObj = element.GetCurrentPattern(pattern);
            else
                patternObj = element.GetCachedPattern(pattern);

            if (patternObj == null)
                throw new Exception(Helpers.PatternNotSupported);

            return patternObj;
        }
All Usage Examples Of System.Windows.Automation.AutomationElement::GetCachedPattern