internal void CallSelectionPattern(PatternCmdletBase cmdlet, IUiElement control, IUiElement inputObject)
{
try {
// ISelectionPattern selPattern = control.GetSelectionPattern();
// ISelectionPattern selPattern = control.GetCurrentPattern<ISelectionPattern, SelectionPattern>();
ISelectionPattern selPattern = control.GetCurrentPattern<ISelectionPattern>(classic.SelectionPattern.Pattern);
if (selPattern != null) {
IUiElement[] selection = AutomationFactory.GetUiEltCollection(selPattern.Current.GetSelection()).Cast<UiElement>().ToArray();
WriteObject(this, selection);
} else {
WriteVerbose(this, "couldn't get SelectionPattern");
WriteObject(this, false);
}
} catch (Exception) {
}
}