XElementHelper.TryGetAttributeValue Method

Namespace
Kampute.DocToolkit.Support
Assembly
  • Kampute.DocToolkit.dll

Definition

Attempts to get the value of the attribute with the specified name.
public static bool TryGetAttributeValue(this XElement element, string attributeName, [NotNullWhen(true)] out string value)

Parameters

element XElement
The XElement instance.
attributeName string
The name of the attribute.
value string
When this method returns, contains the value of the attribute, if the attribute is found; otherwise, null.

Returns

bool
true if the attribute is found and has a value; otherwise, false.