Skip to content

M_CommandLine_ParserResultExtensions_WithParsed__1

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

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

Executes action if parsed values are of T.

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

Syntax

C#

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

VB

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

C++

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

F#

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

Parameters

 

result
Type: CommandLine.ParserResult(Object)
An verb result 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(Object)
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(Object). 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