Open sandboxFocus

Method TryGetNamedArgument

TryGetNamedArgument(IAttribute, string, out TypedConstant)

Tries to get a named argument (i.e. the value assigned to a field or property).

Declaration
public static bool TryGetNamedArgument(this IAttribute attribute, string name, out TypedConstant value)
Parameters
Type Name Description
IAttribute attribute

The attribute to query.

string name

The name of the named argument.

TypedConstant value

When this method returns true, contains the value of the named argument; otherwise, the default value.

Returns
Type Description
bool

true if the attribute defines this named argument, otherwise false.