ExtensionMethodsGetOptionalAttributeT Method (XmlReader, String, FuncString, T, T) |
Gets the value of an optional attribute. If the attribute isn't present, defaultValue is returned.
Namespace:
SD.LLBLGen.Pro.Core.Xml
Assembly:
SD.LLBLGen.Pro.Core (in SD.LLBLGen.Pro.Core.dll) Version: 5.9.0.0 (5.9.0)
Syntax public static T GetOptionalAttribute<T>(
this XmlReader reader,
string attributeName,
Func<string, T> conversionFunc,
T defaultValue
)
<ExtensionAttribute>
Public Shared Function GetOptionalAttribute(Of T) (
reader As XmlReader,
attributeName As String,
conversionFunc As Func(Of String, T),
defaultValue As T
) As T
Parameters
- reader
- Type: System.XmlXmlReader
The reader. - attributeName
- Type: SystemString
Name of the attribute. - conversionFunc
- Type: SystemFuncString, T
The conversion func. - defaultValue
- Type: T
The default value.
Type Parameters
- T
Return Value
Type:
TUsage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
XmlReader. 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).
See Also