System.Windows.Automation.TextPattern2.Wrap C# (CSharp) Method

Wrap() static private method

static private Wrap ( AutomationElement el, object pattern, bool cached ) : object
el AutomationElement
pattern object
cached bool
return object
        internal static new object Wrap(AutomationElement el, object pattern, bool cached)
        {
            TextPattern2 result = null;
            if (pattern != null)
            {
                UIAutomationClient.IUIAutomationTextPattern basePattern =
                    (UIAutomationClient.IUIAutomationTextPattern)el.GetRawPattern(TextPattern.Pattern, cached);
                if (basePattern != null)
                {
                    result = new TextPattern2(el, (UIAutomationClient.IUIAutomationTextPattern2)pattern,
                        basePattern, cached);
                }
            }
            return result;
        }