UIAutomation.PatternCmdletBase.CallValuePatternForSet C# (CSharp) Method

CallValuePatternForSet() private method

private CallValuePatternForSet ( PatternCmdletBase cmdlet, IUiElement control, IUiElement inputObject ) : void
cmdlet PatternCmdletBase
control IUiElement
inputObject IUiElement
return void
        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) {
//            }
        }