语言

IValueSource.TryGetValue(IValueDescriptor, BindingContext, Object) 方法

定义

从绑定上下文中获取值。 返回值指示是否存在与指定值描述符匹配的值。

public:
 bool TryGetValue(System::CommandLine::Binding::IValueDescriptor ^ valueDescriptor, System::CommandLine::Binding::BindingContext ^ bindingContext, [Runtime::InteropServices::Out] System::Object ^ % boundValue);
public bool TryGetValue(System.CommandLine.Binding.IValueDescriptor valueDescriptor, System.CommandLine.Binding.BindingContext bindingContext, out object? boundValue);
abstract member TryGetValue : System.CommandLine.Binding.IValueDescriptor * System.CommandLine.Binding.BindingContext * obj -> bool
Public Function TryGetValue (valueDescriptor As IValueDescriptor, bindingContext As BindingContext, ByRef boundValue As Object) As Boolean

参数

valueDescriptor
IValueDescriptor

要绑定的值的描述符。

bindingContext
BindingContext

要从中绑定值的绑定上下文。

boundValue
Object

绑定值。

返回

true 如果找到匹配值,则为否则,为 false.

适用于