internal virtual object GetCurrentPatternInternal (AutomationPattern pattern)
{
if (pattern == ExpandCollapsePatternIdentifiers.Pattern)
return (SupportsExpandCollapse () ? new ExpandCollapseSource (this) : null);
else if (pattern == GridItemPatternIdentifiers.Pattern)
return (SupportsGridItem () ? new GridItemSource (this) : null);
else if (pattern == GridPatternIdentifiers.Pattern)
return (SupportsGrid () ? new GridSource (this) : null);
else if (pattern == InvokePatternIdentifiers.Pattern)
return (SupportsInvoke () ? new InvokeSource (this) : null);
else if (pattern == RangeValuePatternIdentifiers.Pattern)
return (SupportsRangeValue () ? new RangeValueSource (this) : null);
else if (pattern == SelectionItemPatternIdentifiers.Pattern)
return (SupportsSelectionItem () ? new SelectionItemSource (this) : null);
else if (pattern == SelectionPatternIdentifiers.Pattern)
return (SupportsSelection () ? new SelectionSource (this) : null);
else if (pattern == TableItemPatternIdentifiers.Pattern)
return (SupportsTableItem () ? new TableItemSource (this) : null);
else if (pattern == TablePatternIdentifiers.Pattern)
return (SupportsTable () ? new TableSource (this) : null);
else if (pattern == TextPatternIdentifiers.Pattern)
return (SupportsText () ? new TextSource (this) : null);
else if (pattern == TogglePatternIdentifiers.Pattern)
return (SupportsToggle () ? new ToggleSource (this) : null);
else if (pattern == ValuePatternIdentifiers.Pattern)
return (SupportsValue () ? new ValueSource (this) : null);
return null;
}