SymbolResult.GetValue 方法

定义

重载

名称 说明
GetValue<T>(Argument<T>)

获取指定参数的已分析或默认值。

GetValue<T>(Option<T>)

获取指定选项的已分析或默认值。

GetValue<T>(String)

获取具有分析树中任意位置指定名称的符号的值。

GetValue<T>(Argument<T>)

Source:
SymbolResult.cs
Source:
SymbolResult.cs

获取指定参数的已分析或默认值。

public:
generic <typename T>
 T GetValue(System::CommandLine::Argument<T> ^ argument);
public T? GetValue<T>(System.CommandLine.Argument<T> argument);
member this.GetValue : System.CommandLine.Argument<'T> -> 'T
Public Function GetValue(Of T) (argument As Argument(Of T)) As T

类型参数

T

参数

argument
Argument<T>

要为其获取值的自变量。

返回

T

已分析的值或已配置的默认值。

适用于

GetValue<T>(Option<T>)

Source:
SymbolResult.cs
Source:
SymbolResult.cs

获取指定选项的已分析或默认值。

public:
generic <typename T>
 T GetValue(System::CommandLine::Option<T> ^ option);
public T? GetValue<T>(System.CommandLine.Option<T> option);
member this.GetValue : System.CommandLine.Option<'T> -> 'T
Public Function GetValue(Of T) (option As Option(Of T)) As T

类型参数

T

参数

option
Option<T>

要为其获取值的选项。

返回

T

已分析的值或已配置的默认值。

适用于

GetValue<T>(String)

Source:
SymbolResult.cs
Source:
SymbolResult.cs

获取具有分析树中任意位置指定名称的符号的值。

public:
generic <typename T>
 T GetValue(System::String ^ name);
public T? GetValue<T>(string name);
member this.GetValue : string -> 'T
Public Function GetValue(Of T) (name As String) As T

类型参数

T

参数

name
String

要为其查找结果的符号的名称。

返回

T

如果参数与分析程序匹配或具有默认值,则为参数结果;否则,为 null.

适用于