Click or drag to resize

XmlExtensionsIs Method

Finds all attributes queried from WhereAttribute(IEnumerableXElement, String) that match attributeValue.

Namespace: GSF.Xml
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public static IEnumerable<XElement> Is(
	this IEnumerable<Tuple<XElement, string>> source,
	string attributeValue,
	bool ignoreCase = true
)
View Source

Parameters

source  IEnumerableTupleXElement, String
Attributes queried from WhereAttribute(IEnumerableXElement, String) extension.
attributeValue  String
Attribute value to match.
ignoreCase  Boolean  (Optional)
Flag that determines if attribute value match is case sensitive.

Return Value

IEnumerableXElement
XElement items that match attributeValue.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTupleXElement, String. 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).
Remarks
When used in conjunction with the WhereAttribute(IEnumerableXElement, String) extension, allows for expressions like:
C#
var globals = XDocument.Load(configFile)
    .Descendants("SettingsGroup")
    .WhereAttribute("Type").Is("Globals");
See Also