共用方式為


Argument<T> 建構函式

定義

多載

Argument<T>()

初始化 Argument 類別的新實例。

Argument<T>(Func<T>)

初始化 Argument 類別的新實例。

Argument<T>(ParseArgument<T>, Boolean)

初始化 Argument 類別的新實例。

Argument<T>(String, String)

初始化 Argument 類別的新實例。

Argument<T>(String, Func<T>, String)

初始化 Argument 類別的新實例。

Argument<T>(String, ParseArgument<T>, Boolean, String)

初始化 Argument 類別的新實例。

Argument<T>()

初始化 Argument 類別的新實例。

public:
 Argument();
public Argument ();
Public Sub New ()

適用於

Argument<T>(Func<T>)

初始化 Argument 類別的新實例。

public:
 Argument(Func<T> ^ getDefaultValue);
public Argument (Func<T> getDefaultValue);
new System.CommandLine.Argument<'T> : Func<'T> -> System.CommandLine.Argument<'T>
Public Sub New (getDefaultValue As Func(Of T))

參數

getDefaultValue
Func<T>

要叫用以傳回預設值的委派。

例外狀況

getDefaultValue 為 null 時擲回。

適用於

Argument<T>(ParseArgument<T>, Boolean)

初始化 Argument 類別的新實例。

public Argument (System.CommandLine.Parsing.ParseArgument<T> parse, bool isDefault = false);
new System.CommandLine.Argument<'T> : System.CommandLine.Parsing.ParseArgument<'T> * bool -> System.CommandLine.Argument<'T>
Public Sub New (parse As ParseArgument(Of T), Optional isDefault As Boolean = false)

參數

parse
ParseArgument<T>

自訂自變數剖析器。

isDefault
Boolean

true 表示使用 parse 結果做為預設值。

適用於

Argument<T>(String, String)

初始化 Argument 類別的新實例。

public Argument (string? name, string? description = default);
new System.CommandLine.Argument<'T> : string * string -> System.CommandLine.Argument<'T>
Public Sub New (name As String, Optional description As String = Nothing)

參數

name
String

引數的名稱。

description
String

自變數的描述,如說明所示。

適用於

Argument<T>(String, Func<T>, String)

初始化 Argument 類別的新實例。

public Argument (string name, Func<T> getDefaultValue, string? description = default);
new System.CommandLine.Argument<'T> : string * Func<'T> * string -> System.CommandLine.Argument<'T>
Public Sub New (name As String, getDefaultValue As Func(Of T), Optional description As String = Nothing)

參數

name
String

引數的名稱。

getDefaultValue
Func<T>

要叫用以傳回預設值的委派。

description
String

自變數的描述,如說明所示。

例外狀況

getDefaultValue 為 null 時擲回。

適用於

Argument<T>(String, ParseArgument<T>, Boolean, String)

初始化 Argument 類別的新實例。

public Argument (string? name, System.CommandLine.Parsing.ParseArgument<T> parse, bool isDefault = false, string? description = default);
new System.CommandLine.Argument<'T> : string * System.CommandLine.Parsing.ParseArgument<'T> * bool * string -> System.CommandLine.Argument<'T>
Public Sub New (name As String, parse As ParseArgument(Of T), Optional isDefault As Boolean = false, Optional description As String = Nothing)

參數

name
String

引數的名稱。

parse
ParseArgument<T>

自訂自變數剖析器。

isDefault
Boolean

true 表示使用 parse 結果做為預設值。

description
String

自變數的描述,如說明所示。

例外狀況

parse 為 null 時擲回。

適用於