Compartilhar via


NamedAttributeArgumentAst Constructor

Definition

Construct the ast for a named attribute argument.

public:
 NamedAttributeArgumentAst(System::Management::Automation::Language::IScriptExtent ^ extent, System::String ^ argumentName, System::Management::Automation::Language::ExpressionAst ^ argument, bool expressionOmitted);
public NamedAttributeArgumentAst (System.Management.Automation.Language.IScriptExtent extent, string argumentName, System.Management.Automation.Language.ExpressionAst argument, bool expressionOmitted);
new System.Management.Automation.Language.NamedAttributeArgumentAst : System.Management.Automation.Language.IScriptExtent * string * System.Management.Automation.Language.ExpressionAst * bool -> System.Management.Automation.Language.NamedAttributeArgumentAst
Public Sub New (extent As IScriptExtent, argumentName As String, argument As ExpressionAst, expressionOmitted As Boolean)

Parameters

extent
IScriptExtent

The extent of the named attribute argument, starting with the name, ending with the expression, or if the expression is omitted from the source, then ending at the end of the name.

argumentName
String

The name of the argument specified. May not be null or empty.

argument
ExpressionAst

The argument expression. May not be null even if the expression is omitted from the source.

expressionOmitted
Boolean

True when an explicit argument is not provided in the source, e.g. [Parameter(Mandatory)]. In this case, an ast for the argument expression must still be provided.

Exceptions

If extent, argumentName, or argument is null, or if argumentName is an empty string.

Applies to