XElementExtensions.GetAttributeValueAsInt64 method
Namespace | Skybrud.Essentials.Xml.Extensions |
---|---|
Assembly | Skybrud.Essentials.dll |
GetAttributeValueAsInt64(XElement, XName)
Gets an instance of long representing the value of the attribute matching the
specified name
. If a matching attribute ins't found, the default value of
long will be returned instead.
public static long GetAttributeValueAsInt64(this XElement element, XName name)
Parameters
GetAttributeValueAsInt64(XElement, XName, out long)
Gets an instance of long representing the value of the attribute matching the
specified name
. If a matching attribute ins't found, the default value of
long will be returned instead.
public static bool GetAttributeValueAsInt64(this XElement element, XName name, long value)
Parameters
Returns
true
if a matching element was found; otherwise false
.
GetAttributeValueAsInt64<T>(XElement, XName, Func<T, TResult>)
Gets an instance of T
representing the value of the attribute matching the
specified name
. If a matching attribute ins't found, the default value of
T
will be returned instead.
public static T GetAttributeValueAsInt64<T>(this XElement element, XName name, Func<T, TResult> callback)
Type Parameters
T
Parameters
The callback method used for converting the attribute value.
Returns
T
An instance of T
representing the attribute value, or the default value
of T
if a matching attribute wasn't found.
GetAttributeValueAsInt64(XElement, string)
Gets an instance of long representing the value of the attribute matching the
specified XPath expression
. If a matching attribute ins't found, the default value of
long will be returned instead.
public static long GetAttributeValueAsInt64(this XElement element, string expression)
Parameters
expression
String
The XPath expression the attribute should match.
GetAttributeValueAsInt64<T>(XElement, string, Func<T, TResult>)
Gets an instance of T
representing the value of the attribute matching the specified
XPath expression
. If a matching attribute ins't found found, the default value of
T
will be returned instead.
public static T GetAttributeValueAsInt64<T>(this XElement element, string expression, Func<T, TResult> callback)
Type Parameters
T
Parameters
expression
String
The XPath expression the attribute should match.
The callback method used for converting the attribute value.
Returns
T
An instance of T
representing the attribute value, or the default value
of T
if a matching attribute wasn't found.
GetAttributeValueAsInt64(XElement, string, IXmlNamespaceResolver)
Gets an instance of long representing the value of the attribute matching the
specified XPath expression
. If a matching attribute ins't found, the default value of
long will be returned instead.
public static long GetAttributeValueAsInt64(this XElement element, string expression, IXmlNamespaceResolver resolver)
Parameters
expression
String
The XPath expression the attribute should match.
resolver
IXmlNamespaceResolver
An instance of IXmlNamespaceResolver for resolving namespace prefixes in the XPath expression.
GetAttributeValueAsInt64(XElement, string, out long)
Gets an instance of long representing the value of the attribute matching the
specified XPath expression
. If a matching attribute ins't found, the default value of
long will be returned instead.
public static bool GetAttributeValueAsInt64(this XElement element, string expression, long value)
Parameters
expression
String
The XPath expression the attribute should match.
Returns
true
if a matching element was found; otherwise false
.
GetAttributeValueAsInt64(XElement, string, IXmlNamespaceResolver, out long)
Gets an instance of long representing the value of the attribute matching the
specified XPath expression
. If a matching attribute ins't found, the default value of
long will be returned instead.
public static bool GetAttributeValueAsInt64(this XElement element, string expression, IXmlNamespaceResolver resolver, long value)
Parameters
expression
String
The XPath expression the attribute should match.
resolver
IXmlNamespaceResolver
An instance of IXmlNamespaceResolver for resolving namespace prefixes in the XPath expression.
Returns
true
if a matching element was found; otherwise false
.
GetAttributeValueAsInt64<T>(XElement, string, IXmlNamespaceResolver, Func<T, TResult>)
Gets an instance of T
representing the value of the attribute matching the specified
XPath expression
. If a matching attribute ins't found found, the default value of
T
will be returned instead.
public static T GetAttributeValueAsInt64<T>(this XElement element, string expression, IXmlNamespaceResolver resolver, Func<T, TResult> callback)
Type Parameters
T
Parameters
expression
String
The XPath expression the attribute should match.
resolver
IXmlNamespaceResolver
An instance of IXmlNamespaceResolver for resolving namespace prefixes in the XPath expression.
The callback method used for converting the attribute value.
Returns
T
An instance of T
representing the attribute value, or the default value
of T
if a matching attribute wasn't found.