|
XmlExtensions.Is Method
|
Namespace: GSF.XmlAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.239-beta+5928cebde0dd955df84e791f5ea67acbd192773e
Syntaxpublic static IEnumerable<XElement> Is(
this IEnumerable<Tuple<XElement, string>> source,
string attributeValue,
bool ignoreCase = true
)
<ExtensionAttribute>
Public Shared Function Is (
source As IEnumerable(Of Tuple(Of XElement, String)),
attributeValue As String,
Optional ignoreCase As Boolean = true
) As IEnumerable(Of XElement)
public:
[ExtensionAttribute]
static IEnumerable<XElement^>^ Is(
IEnumerable<Tuple<XElement^, String^>^>^ source,
String^ attributeValue,
bool ignoreCase = true
)
[<ExtensionAttribute>]
static member Is :
source : IEnumerable<Tuple<XElement, string>> *
attributeValue : string *
?ignoreCase : bool
(* Defaults:
let _ignoreCase = defaultArg ignoreCase true
*)
-> IEnumerable<XElement>
GSF.Xml.XmlExtensions.Is = function(source, attributeValue, ignoreCase);
View SourceParameters
- 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:
var globals = XDocument.Load(configFile)
.Descendants("SettingsGroup")
.WhereAttribute("Type").Is("Globals");
See Also