แก้ไข

แชร์ผ่าน


Argument.SetDefaultValueFactory Method

Definition

Overloads

SetDefaultValueFactory(Func<ArgumentResult,Object>)

Sets a delegate to invoke when the default value for the argument is required.

SetDefaultValueFactory(Func<Object>)

Sets a delegate to invoke when the default value for the argument is required.

SetDefaultValueFactory(Func<ArgumentResult,Object>)

Sets a delegate to invoke when the default value for the argument is required.

public:
 void SetDefaultValueFactory(Func<System::CommandLine::Parsing::ArgumentResult ^, System::Object ^> ^ getDefaultValue);
public void SetDefaultValueFactory (Func<System.CommandLine.Parsing.ArgumentResult,object?> getDefaultValue);
member this.SetDefaultValueFactory : Func<System.CommandLine.Parsing.ArgumentResult, obj> -> unit
Public Sub SetDefaultValueFactory (getDefaultValue As Func(Of ArgumentResult, Object))

Parameters

getDefaultValue
Func<ArgumentResult,Object>

The delegate to invoke to return the default value.

Remarks

In this overload, the ArgumentResult is provided to the delegate.

Applies to

SetDefaultValueFactory(Func<Object>)

Sets a delegate to invoke when the default value for the argument is required.

public:
 void SetDefaultValueFactory(Func<System::Object ^> ^ getDefaultValue);
public void SetDefaultValueFactory (Func<object?> getDefaultValue);
member this.SetDefaultValueFactory : Func<obj> -> unit
Public Sub SetDefaultValueFactory (getDefaultValue As Func(Of Object))

Parameters

getDefaultValue
Func<Object>

The delegate to invoke to return the default value.

Exceptions

Thrown when getDefaultValue is null.

Applies to