internal void CallCollapsePattern(PatternCmdletBase cmdlet, IUiElement control, IUiElement inputObject)
{
try {
control.PerformCollapse();
if (PassThru) {
WriteObject(this, control);
} else {
WriteObject(this, true);
}
}
catch {
WriteObject(this, false);
}
// try {
// // IExpandCollapsePattern collapsePattern = control.GetExpandCollapsePattern();
// // IExpandCollapsePattern collapsePattern = control.GetCurrentPattern<IExpandCollapsePattern, ExpandCollapsePattern>();
// IExpandCollapsePattern collapsePattern = control.GetCurrentPattern<IExpandCollapsePattern>(classic.ExpandCollapsePattern.Pattern);
// if (collapsePattern != null) {
// collapsePattern.Collapse();
//
// 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 eCollPatternException) {
// }
}