internal void CallExpandPattern(PatternCmdletBase cmdlet, IUiElement control, IUiElement inputObject)
{
try {
control.PerformExpand();
if (PassThru) {
WriteObject(this, control);
} else {
WriteObject(this, true);
}
} catch (Exception) {
WriteObject(this, false);
// throw;
}
// try {
// // IExpandCollapsePattern expandPattern = control.GetExpandCollapsePattern();
// // IExpandCollapsePattern expandPattern = control.GetCurrentPattern<IExpandCollapsePattern, ExpandCollapsePattern>();
// IExpandCollapsePattern expandPattern = control.GetCurrentPattern<IExpandCollapsePattern>(classic.ExpandCollapsePattern.Pattern);
// if (expandPattern != null) {
// expandPattern.Expand();
//
// if (PassThru && null != (inputObject as IUiElement)) {
// WriteObject(this, inputObject);
// } else {
// WriteObject(this, true);
// }
// } else {
// WriteVerbose(this, "couldn't get ExpandCollapsePattern");
// WriteObject(this, false);
// }
// } catch (Exception eExpPatternException) {
// }
}