BinderBase<T>.IValueSource.TryGetValue 方法

定义

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

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

参数

valueDescriptor
IValueDescriptor

要绑定的值的描述符。

bindingContext
BindingContext

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

boundValue
Object

此方法返回时,包含绑定值。

返回

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

实现

适用于