Skip to content

M_CommandLine_ParserResultExtensions_WithParsed__1_1

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

ParserResultExtensions.WithParsed(T) Method (ParserResult(T), Action(T))

Executes action if ParserResult(T) contains parsed values.

Namespace: CommandLine
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0

Syntax

C#

public static ParserResult<T> WithParsed<T>(
	this ParserResult<T> result,
	Action<T> action
)

VB

<ExtensionAttribute>
Public Shared Function WithParsed(Of T) ( 
	result As ParserResult(Of T),
	action As Action(Of T)
) As ParserResult(Of T)

C++

public:
[ExtensionAttribute]
generic<typename T>
static ParserResult<T>^ WithParsed(
	ParserResult<T>^ result, 
	Action<T>^ action
)

F#

[<ExtensionAttribute>]
static member WithParsed : 
        result : ParserResult<'T> * 
        action : Action<'T> -> ParserResult<'T> 

Parameters

 

result
Type: CommandLine.ParserResult(T)
An ParserResult(T) instance.
action
Type: System.Action(T)
The Action(T) to execute.

Type Parameters

 

T
Type of the target instance built with parsed value.

Return Value

Type: ParserResult(T)
The same result instance.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ParserResult(T). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

ParserResultExtensions Class
WithParsed Overload
CommandLine Namespace

Clone this wiki locally