internal void CallValuePatternForSet(PatternCmdletBase cmdlet, IUiElement control, IUiElement inputObject)
{
try {
control.PerformSetValueValuePattern(((InvokeUiaValuePatternSetCommand)Child).Text);
if (PassThru) {
WriteObject(this, control);
} else {
WriteObject(this, true);
}
}
catch {
WriteObject(this, false);
}
// try {
// // IValuePattern valuePatternSet = control.GetValuePattern();
// // IValuePattern valuePatternSet = control.GetCurrentPattern<IValuePattern, ValuePattern>(); //ValuePattern.Pattern);
// IValuePattern valuePatternSet = control.GetCurrentPattern<IValuePattern>(classic.ValuePattern.Pattern);
// if (valuePatternSet != null) {
//
// WriteVerbose(this, "using ValuePattern");
// valuePatternSet.SetValue(((InvokeUiaValuePatternSetCommand)Child).Text);
//
// if (PassThru && null != (inputObject as IUiElement)) {
// WriteObject(this, inputObject);
// } else {
// WriteObject(this, true);
// }
// } else {
//
// WriteVerbose(this, "couldn't get ValuePattern. SendKeys is used");
// control.SetFocus();
// SendKeys.SendWait(((InvokeUiaValuePatternSetCommand)Child).Text);
//
// if (PassThru && null != (inputObject as IUiElement)) {
// WriteObject(this, inputObject);
// } else {
// WriteObject(this, true);
// }
// }
// } catch (Exception eValueSetPatternException) {
// }
}