Click or drag to resize

XmlExtensions.Is Method

Finds all attributes queried from WhereAttribute(IEnumerable<XElement> , String) that match attributeValue.

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

Parameters

source  IEnumerable<Tuple<XElement, String>>
Attributes queried from WhereAttribute(IEnumerable<XElement> , String) extension.
attributeValue  String
Attribute value to match.
ignoreCase  Boolean  (Optional)
Flag that determines if attribute value match is case sensitive.

Return Value

IEnumerable<XElement>
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 IEnumerable<Tuple<XElement, 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(IEnumerable<XElement> , String) extension, allows for expressions like:
C#
var globals = XDocument.Load(configFile)
    .Descendants("SettingsGroup")
    .WhereAttribute("Type").Is("Globals");
See Also