Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
3151 lines (2817 sloc) 168 KB
<Type Name="XAttribute" FullName="System.Xml.Linq.XAttribute">
<TypeSignature Language="C#" Value="public class XAttribute : System.Xml.Linq.XObject" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit XAttribute extends System.Xml.Linq.XObject" />
<TypeSignature Language="DocId" Value="T:System.Xml.Linq.XAttribute" />
<TypeSignature Language="VB.NET" Value="Public Class XAttribute&#xA;Inherits XObject" />
<TypeSignature Language="C++ CLI" Value="public ref class XAttribute : System::Xml::Linq::XObject" />
<TypeSignature Language="F#" Value="type XAttribute = class&#xA; inherit XObject" />
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Xml.Linq.XObject</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.ComponentModel.TypeDescriptionProvider(typeof(MS.Internal.Xml.Linq.ComponentModel.XTypeDescriptionProvider`1&lt;System.Xml.Linq.XAttribute&gt;))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-3.5">
<AttributeName>System.ComponentModel.TypeDescriptionProvider(typeof(System.Xml.Linq.ComponentModel.XTypeDescriptionProvider`1&lt;System.Xml.Linq.XAttribute&gt;))</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents an XML attribute.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
An XML attribute is a name/value pair associated with an XML element.
Each <xref:System.Xml.Linq.XElement> contains a list of the attributes for that element. Attributes must have a qualified name that is unique to the element. Attributes are not derived from <xref:System.Xml.Linq.XNode>; they are not nodes in the XML tree. Instead, they are simply name/value pairs associated with an element.
Attributes are maintained in the XML tree in the order that they were added to the element. When a collection of attributes is returned by <xref:System.Xml.Linq.XElement.Attributes%2A>, they are returned in the order that they were added to the element, and are not sorted.
Technically, in XML, namespace declarations are not attributes proper. However, this distinction is not normally made by many XML programmers. Instead, because namespace declarations have exactly the same XML syntax as attributes, most XML programmers think of namespaces as attributes. To simplify the [!INCLUDE[sqltecxlinq](~/includes/sqltecxlinq-md.md)] programming interface, namespaces are represented in the XML tree as attributes. Such namespace attributes impact serialization of an XML tree. When serializing, [!INCLUDE[sqltecxlinq](~/includes/sqltecxlinq-md.md)] attempts to serialize with the namespace prefix specified in namespace attributes. You can use the <xref:System.Xml.Linq.XAttribute.IsNamespaceDeclaration%2A> to determine if an attribute is really a namespace declaration.
The <xref:System.Xml.Linq.XAttribute> class derives from <xref:System.Xml.Linq.XObject>. You can add annotations to attributes, and observe events for them.
Some <xref:System.Xml.Linq.XAttribute> methods can be used from XAML. For more information, see [LINQ to XML Dynamic Properties](https://msdn.microsoft.com/library/0455f47c-4a68-4f2e-a3f8-dd1d85b99012).
]]></format>
</remarks>
<altmember cref="T:System.Xml.Linq.XElement" />
<altmember cref="T:System.Xml.Linq.XDocument" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
<related type="Article" href="https://msdn.microsoft.com/library/ab0fed32-994c-4593-b307-54aa72c6bdc3">XAttribute Class Overview</related>
<related type="Article" href="https://msdn.microsoft.com/library/0455f47c-4a68-4f2e-a3f8-dd1d85b99012">LINQ to XML Dynamic Properties</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Xml.Linq.XAttribute" /> class.</summary>
<altmember cref="P:System.Xml.Linq.XAttribute.Name" />
<altmember cref="P:System.Xml.Linq.XAttribute.Value" />
<altmember cref="P:System.Xml.Linq.XAttribute.NodeType" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
<related type="Article" href="https://msdn.microsoft.com/library/ab0fed32-994c-4593-b307-54aa72c6bdc3">XAttribute Class Overview</related>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XAttribute (System.Xml.Linq.XAttribute other);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Xml.Linq.XAttribute other) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.#ctor(System.Xml.Linq.XAttribute)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (other As XAttribute)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; XAttribute(System::Xml::Linq::XAttribute ^ other);" />
<MemberSignature Language="F#" Value="new System.Xml.Linq.XAttribute : System.Xml.Linq.XAttribute -&gt; System.Xml.Linq.XAttribute" Usage="new System.Xml.Linq.XAttribute other" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="other" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="other">An <see cref="T:System.Xml.Linq.XAttribute" /> object to copy from.</param>
<summary>Initializes a new instance of the <see cref="T:System.Xml.Linq.XAttribute" /> class from another <see cref="T:System.Xml.Linq.XAttribute" /> object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is primarily used internally when making a deep copy of an XML tree.
## Examples
This example demonstrates that creating a deep copy of an XML tree creates a copy, not a clone, of an attribute in the tree.
```csharp
XElement root1 = XElement.Parse("<Root Att1='abc' />");
// Make a deep copy.
XElement root2 = new XElement(root1);
if (root1.Attribute("Att1") == root2.Attribute("Att1"))
Console.WriteLine("This will not be printed");
else
Console.WriteLine("Creating a deep copy created a new attribute from the original.");
```
```vb
Dim root1 As XElement = <Root Att1='abc'/>
' Make a deep copy.
Dim root2 As XElement = New XElement(root1)
If root1.Attribute("Att1") Is root2.Attribute("Att1") Then
Console.WriteLine("This will not be printed")
Else
Console.WriteLine("Creating a deep copy created a new attribute from the original.")
End If
```
This example produces the following output:
```
Creating a deep copy created a new attribute from the original.
```
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="other" /> parameter is <see langword="null" />.</exception>
<altmember cref="P:System.Xml.Linq.XAttribute.Name" />
<altmember cref="P:System.Xml.Linq.XAttribute.Value" />
<altmember cref="P:System.Xml.Linq.XAttribute.NodeType" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
<related type="Article" href="https://msdn.microsoft.com/library/ab0fed32-994c-4593-b307-54aa72c6bdc3">XAttribute Class Overview</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XAttribute (System.Xml.Linq.XName name, object value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Xml.Linq.XName name, object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.#ctor(System.Xml.Linq.XName,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (name As XName, value As Object)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; XAttribute(System::Xml::Linq::XName ^ name, System::Object ^ value);" />
<MemberSignature Language="F#" Value="new System.Xml.Linq.XAttribute : System.Xml.Linq.XName * obj -&gt; System.Xml.Linq.XAttribute" Usage="new System.Xml.Linq.XAttribute (name, value)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="name" Type="System.Xml.Linq.XName" />
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="name">The <see cref="T:System.Xml.Linq.XName" /> of the attribute.</param>
<param name="value">An <see cref="T:System.Object" /> containing the value of the attribute.</param>
<summary>Initializes a new instance of the <see cref="T:System.Xml.Linq.XAttribute" /> class from the specified name and value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
There is an implicit conversion from string to <xref:System.Xml.Linq.XName>. Typical use of this constructor is to specify a string as the first parameter instead of creating a new <xref:System.Xml.Linq.XName>, as follows:
```csharp
XElement root = new XElement("Root",
new XAttribute("AnAttributeName", "Content")
);
```
You can also use the addition operator overload with an <xref:System.Xml.Linq.XNamespace> and a string to create an <xref:System.Xml.Linq.XName>, as follows:
```csharp
XNamespace aw = "http://www.adventure-works.com";
XElement root = new XElement(aw + "Root",
new XAttribute(aw + "AnAttributeName", "Content")
);
```
For more information, see [Working with XML Namespaces](https://msdn.microsoft.com/library/e3003209-3234-45be-a832-47feb7927430).
These same approaches will work for Visual Basic, however XML literals provide a better approach for creating XML trees.
The `value` parameter can be a <xref:System.String>, `double`, `float`, `decimal`, `bool`, <xref:System.DateTime>, or <xref:System.TimeSpan>. If the value is a <xref:System.DateTime> or <xref:System.TimeSpan>, the value of the attribute is formatted correctly per the W3C specifications.
## Examples
The following example uses this constructor to create attributes. It passes strings as the first argument to the <xref:System.Xml.Linq.XAttribute> constructor, which are then implicitly converted to <xref:System.Xml.Linq.XName> objects. The attributes are added to an element.
```csharp
XElement root;
double dbl = 12.345;
XAttribute[] attArray = {
new XAttribute("Att4", 1),
new XAttribute("Att5", 2),
new XAttribute("Att6", 3)
};
DateTime dt = new DateTime(2006, 10, 6, 12, 30, 00);
// string content
root = new XElement("Root",
new XAttribute("Att1", "Some text"),
// double content
new XAttribute("Att2", dbl),
// DateTime content
new XAttribute("Att3", dt),
// XAttribute array content
attArray
);
Console.WriteLine(root);
```
```vb
Dim dbl As Double = 12.345
Dim attArray As XAttribute() = { _
New XAttribute("Att4", 1), _
New XAttribute("Att5", 2), _
New XAttribute("Att6", 3) _
}
Dim dt As DateTime = New DateTime(2006, 10, 6, 12, 30, 0)
Dim root As XElement = <Root Att1="Some text"
Att2=<%= dbl %>
Att3=<%= dt %>
<%= attArray %>
/>
Console.WriteLine(root)
```
This example produces the following output:
```
<Root Att1="Some text" Att2="12.345" Att3="2006-10-06T12:30:00" Att4="1" Att5="2" Att6="3" />
```
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="name" /> or <paramref name="value" /> parameter is <see langword="null" />.</exception>
<altmember cref="P:System.Xml.Linq.XAttribute.Name" />
<altmember cref="P:System.Xml.Linq.XAttribute.Value" />
<altmember cref="P:System.Xml.Linq.XAttribute.NodeType" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
<related type="Article" href="https://msdn.microsoft.com/library/ab0fed32-994c-4593-b307-54aa72c6bdc3">XAttribute Class Overview</related>
</Docs>
</Member>
<Member MemberName="EmptySequence">
<MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable&lt;System.Xml.Linq.XAttribute&gt; EmptySequence { get; }" />
<MemberSignature Language="ILAsm" Value=".property class System.Collections.Generic.IEnumerable`1&lt;class System.Xml.Linq.XAttribute&gt; EmptySequence" />
<MemberSignature Language="DocId" Value="P:System.Xml.Linq.XAttribute.EmptySequence" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly Property EmptySequence As IEnumerable(Of XAttribute)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static property System::Collections::Generic::IEnumerable&lt;System::Xml::Linq::XAttribute ^&gt; ^ EmptySequence { System::Collections::Generic::IEnumerable&lt;System::Xml::Linq::XAttribute ^&gt; ^ get(); };" />
<MemberSignature Language="F#" Value="member this.EmptySequence : seq&lt;System.Xml.Linq.XAttribute&gt;" Usage="System.Xml.Linq.XAttribute.EmptySequence" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Generic.IEnumerable&lt;System.Xml.Linq.XAttribute&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets an empty collection of attributes.</summary>
<value>An <see cref="T:System.Collections.Generic.IEnumerable`1" /> of <see cref="T:System.Xml.Linq.XAttribute" /> containing an empty collection.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is typically used by class implementers when writing a method that returns a collection of attributes. If the method needs to return an empty collection of attributes, it could use this property to get an empty collection of <xref:System.Xml.Linq.XAttribute> objects.
]]></format>
</remarks>
<altmember cref="P:System.Xml.Linq.XElement.EmptySequence" />
<altmember cref="Overload:System.Xml.Linq.XAttribute.#ctor" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="IsNamespaceDeclaration">
<MemberSignature Language="C#" Value="public bool IsNamespaceDeclaration { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsNamespaceDeclaration" />
<MemberSignature Language="DocId" Value="P:System.Xml.Linq.XAttribute.IsNamespaceDeclaration" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsNamespaceDeclaration As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsNamespaceDeclaration { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsNamespaceDeclaration : bool" Usage="System.Xml.Linq.XAttribute.IsNamespaceDeclaration" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Determines if this attribute is a namespace declaration.</summary>
<value>
<see langword="true" /> if this attribute is a namespace declaration; otherwise <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Technically, in XML, namespace declarations are not attributes proper. However, this distinction is not normally made by most XML programmers. Instead, because namespace declarations have exactly the same syntax as attributes, most XML programmers think of namespaces as attributes. To simplify the [!INCLUDE[sqltecxlinq](~/includes/sqltecxlinq-md.md)] programming interface, namespaces are represented in the XML tree as attributes. You can use this property to determine if a particular [!INCLUDE[sqltecxlinq](~/includes/sqltecxlinq-md.md)] attribute is really a namespace declaration.
## Examples
The following example creates an attribute that is a namespace declaration and an attribute that is not. It then uses this property to display whether each attribute is a namespace declaration or not.
```csharp
XNamespace aw = "http://www.adventure-works.com";
XElement root = new XElement(aw + "Root",
new XAttribute(XNamespace.Xmlns + "aw", "http://www.adventure-works.com"),
new XAttribute(aw + "Att", "content")
);
foreach (XAttribute att in root.Attributes()) {
if (att.IsNamespaceDeclaration)
Console.WriteLine("{0} is a namespace declaration", att.Name);
else
Console.WriteLine("{0} is not a namespace declaration", att.Name);
}
```
```vb
Dim root As XElement = <aw:Root xmlns:aw='http://www.adventure-works.com'
aw:Att='content'/>
For Each att As XAttribute In root.Attributes()
If (att.IsNamespaceDeclaration) Then
Console.WriteLine("{0} is a namespace declaration", att.Name)
Else
Console.WriteLine("{0} is not a namespace declaration", att.Name)
End If
Next
```
This example produces the following output:
```
{http://www.w3.org/2000/xmlns/}aw is a namespace declaration
{http://www.adventure-works.com}Att is not a namespace declaration
```
]]></format>
</remarks>
<altmember cref="T:System.Xml.Linq.XNamespace" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="Name">
<MemberSignature Language="C#" Value="public System.Xml.Linq.XName Name { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Xml.Linq.XName Name" />
<MemberSignature Language="DocId" Value="P:System.Xml.Linq.XAttribute.Name" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Name As XName" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Xml::Linq::XName ^ Name { System::Xml::Linq::XName ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Name : System.Xml.Linq.XName" Usage="System.Xml.Linq.XAttribute.Name" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Xml.Linq.XName</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the expanded name of this attribute.</summary>
<value>An <see cref="T:System.Xml.Linq.XName" /> containing the name of this attribute.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The expanded name returned by this property is in the form of `{namespace}localname`.
## Examples
The following example creates an element with three attributes. It then uses this property to print out the name of each attribute. The example also shows creation of a new attribute using the name of an existing attribute.
```csharp
XNamespace aw = "http://www.adventure-works.com";
XElement root = new XElement(aw + "Root",
new XAttribute(XNamespace.Xmlns + "aw", "http://www.adventure-works.com"),
new XAttribute(aw + "Att", "content"),
new XAttribute("Att2", "different content")
);
foreach (XAttribute att in root.Attributes())
Console.WriteLine("{0}={1}", att.Name, att.Value);
Console.WriteLine("");
XElement newRoot = new XElement(aw + "Root",
from att in root.Attributes("Att2")
select new XAttribute(att.Name, "new content"));
foreach (XAttribute att in newRoot.Attributes())
Console.WriteLine("{0}={1}", att.Name, att.Value);
```
```vb
Dim root As XElement = _
<aw:Root xmlns:aw='http://www.adventure-works.com'
aw:Att='content'
Att2='different content'/>
For Each att As XAttribute In root.Attributes()
Console.WriteLine("{0}={1}", att.Name, att.Value)
Next
Console.WriteLine("")
Dim NewRoot As XElement = _
<Root
<%= _
From att In root.Attributes("Att2") _
Select New XAttribute(att.Name, "new content") _
%>>_
</Root>
For Each att As XAttribute In NewRoot.Attributes()
Console.WriteLine("{0}={1}", att.Name, att.Value)
Next
```
This example produces the following output:
```
{http://www.w3.org/2000/xmlns/}aw=http://www.adventure-works.com
{http://www.adventure-works.com}Att=content
Att2=different content
Att2=new content
```
]]></format>
</remarks>
<altmember cref="T:System.Xml.Linq.XName" />
<altmember cref="P:System.Xml.Linq.XAttribute.Value" />
<altmember cref="M:System.Xml.Linq.XAttribute.ToString" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="NextAttribute">
<MemberSignature Language="C#" Value="public System.Xml.Linq.XAttribute NextAttribute { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Xml.Linq.XAttribute NextAttribute" />
<MemberSignature Language="DocId" Value="P:System.Xml.Linq.XAttribute.NextAttribute" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property NextAttribute As XAttribute" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Xml::Linq::XAttribute ^ NextAttribute { System::Xml::Linq::XAttribute ^ get(); };" />
<MemberSignature Language="F#" Value="member this.NextAttribute : System.Xml.Linq.XAttribute" Usage="System.Xml.Linq.XAttribute.NextAttribute" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.Linq.XAttribute</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the next attribute of the parent element.</summary>
<value>An <see cref="T:System.Xml.Linq.XAttribute" /> containing the next attribute of the parent element.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Attributes are maintained in the XML tree in the order that they were added to the element. When a collection of attributes is returned by <xref:System.Xml.Linq.XElement.Attributes%2A>, they are returned in the order that they were added, and are not sorted. When you request the next attribute through this property, this property returns the attribute that was added after this attribute.
If this attribute does not have a parent, or if there is no next attribute, then this property returns `null`.
## Examples
The following example shows how to iterate through the attributes of an element using this property.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att1", 1),
new XAttribute("Att2", 2),
new XAttribute("Att3", 3),
new XAttribute("Att4", 4)
);
XAttribute att = root.FirstAttribute;
do {
Console.WriteLine(att);
}
while((att = att.NextAttribute) != null);
```
```vb
Dim root As XElement = <Root Att1="1" Att2="2" Att3="3" Att4="4"/>
Dim att As XAttribute = root.FirstAttribute
Dim val As Boolean = True
Do
Console.WriteLine(att)
att = att.NextAttribute
Loop While (Not (att Is Nothing))
```
This example produces the following output:
```
Att1="1"
Att2="2"
Att3="3"
Att4="4"
```
]]></format>
</remarks>
<altmember cref="P:System.Xml.Linq.XAttribute.PreviousAttribute" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="NodeType">
<MemberSignature Language="C#" Value="public override System.Xml.XmlNodeType NodeType { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Xml.XmlNodeType NodeType" />
<MemberSignature Language="DocId" Value="P:System.Xml.Linq.XAttribute.NodeType" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property NodeType As XmlNodeType" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Xml::XmlNodeType NodeType { System::Xml::XmlNodeType get(); };" />
<MemberSignature Language="F#" Value="member this.NodeType : System.Xml.XmlNodeType" Usage="System.Xml.Linq.XAttribute.NodeType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlNodeType</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the node type for this node.</summary>
<value>The node type. For <see cref="T:System.Xml.Linq.XAttribute" /> objects, this value is <see cref="F:System.Xml.XmlNodeType.Attribute" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Because all classes that derive from <xref:System.Xml.Linq.XObject> contain a <xref:System.Xml.Linq.XObject.NodeType%2A> property, you can write code that operates on collections of concrete subclass of <xref:System.Xml.Linq.XObject>. Your code can then test for the node type of each node in the collection.
## Examples
The following example creates an attribute, and then displays the node type using this property.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", "content")
);
XAttribute att = root.FirstAttribute;
Console.WriteLine(att.NodeType);
```
```vb
Dim root As XElement = <Root Att="content"/>
Dim att As XAttribute = root.FirstAttribute
Console.WriteLine(att.NodeType.ToString)
```
This example produces the following output:
```
Attribute
```
]]></format>
</remarks>
<altmember cref="T:System.Xml.XmlNodeType" />
<altmember cref="T:System.Xml.Linq.XNode" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator bool (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Boolean" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator bool(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; bool" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Boolean" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Boolean" />.</summary>
<returns>A <see cref="T:System.Boolean" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When converting to <xref:System.Boolean> from an attribute or element, allowed values are "0", "1", and any string that produces "true" or "false" after trimming and conversion to lower case.
## Examples
The following example creates an attribute with a <xref:System.Boolean> value, then casts it to <xref:System.Boolean>.
```csharp
XElement root = new XElement("Root",
new XAttribute("BoolValue", true)
);
bool bv = (bool)root.Attribute("BoolValue");
Console.WriteLine("(bool)BoolValue={0}", bv);
```
```vb
Dim root As XElement = <root BoolValue="true"/>
Dim bv As Boolean = CBool(root.Attribute("BoolValue"))
Console.WriteLine("(bool)BoolValue={0}", bv)
```
This example produces the following output:
```
(bool)BoolValue=True
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Boolean" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Boolean}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator DateTime (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.DateTime op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.DateTime" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator DateTime(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; DateTime" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.DateTime" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.DateTime" />.</summary>
<returns>A <see cref="T:System.DateTime" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value space of an attribute or element that contains date and time content is closely related to the dates and times described in ISO 8601. When creating an attribute or element that contains date and time content, the attribute or element values are formatted per the W3C specification. See the W3C specification for more details.
Behavior is lax when casting to a <xref:System.DateTime> from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a <xref:System.DateTime>.
This conversion operator uses <xref:System.Globalization.CultureInfo.InvariantCulture%2A?displayProperty=nameWithType> to convert from a <xref:System.DateTime>.
## Examples
The following example creates an attribute with date and time content. It then casts it to <xref:System.DateTime> to retrieve the value.
```csharp
// Behavior is strict when formatting an XML element or attribute from a DateTime,
// but behavior is lax when casting to a DateTime from an element or attribute.
XElement root = new XElement("Root",
new XAttribute("Att", new DateTime(2006, 10, 6, 12, 30, 0))
);
Console.WriteLine(root);
// casting from a strictly formatted XML attribute
DateTime dt = (DateTime)root.Attribute("Att");
Console.WriteLine("dt={0}", dt);
Console.WriteLine("-----");
// if root is formatted in some different way than the standard ISO 8601, if at all possible,
// the value is appropriately converted to DateTime
XAttribute dtAtt = new XAttribute("OrderDate", "October 6, 2006");
Console.WriteLine(dtAtt);
DateTime orderDate = (DateTime)dtAtt;
Console.WriteLine("OrderDate={0:d}", orderDate);
```
```vb
' Behavior is strict when formatting an XML element or attribute from a DateTime,
' but behavior is lax when casting to a DateTime from an element or attribute.
Dim root As XElement = <Root Att=<%= New DateTime(2006, 10, 6, 12, 30, 0) %>/>
Console.WriteLine(root)
' casting from a strictly formatted XML attribute
Dim dt As DateTime = CType(root.Attribute("Att"), DateTime)
Console.WriteLine("dt={0}", dt)
Console.WriteLine("-----")
' if root is formatted in some different way than the standard ISO 8601, if at all possible,
' the value is appropriately converted to DateTime
Dim dtAtt As XAttribute = New XAttribute("OrderDate", "October 6, 2006")
Console.WriteLine(dtAtt)
Dim orderDate As DateTime = CType(dtAtt, DateTime)
Console.WriteLine("OrderDate={0:d}", orderDate)
```
This example produces the following output:
```
<Root Att="2006-10-06T12:30:00" />
dt=10/6/2006 12:30:00 PM
-----
OrderDate="October 6, 2006"
OrderDate=10/6/2006
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.DateTime" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.DateTime}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator DateTimeOffset (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.DateTimeOffset op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.DateTimeOffset" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator DateTimeOffset(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; DateTimeOffset" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.DateTimeOffset" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.DateTimeOffset" />.</summary>
<returns>A <see cref="T:System.DateTimeOffset" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This conversion operator uses the <xref:System.Xml.XmlConvert> class to do the conversion.
## Examples
The following example creates an attribute with date and time content. It then casts it to <xref:System.DateTimeOffset> to retrieve the value.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", new DateTimeOffset(new DateTime(2006, 10, 6, 12, 30, 0)))
);
Console.WriteLine(root);
// casting from a strictly formatted XML attribute
DateTimeOffset dt = (DateTimeOffset)root.Attribute("Att");
Console.WriteLine("dt={0}", dt);
```
```vb
Dim root As XElement = _
<Root
Att=<%= New DateTimeOffset(New DateTime(2006, 10, 6, 12, 30, 0)) %>/>
Console.WriteLine(root)
' casting from a strictly formatted XML attribute
Dim dt As DateTimeOffset = CType(root.Attribute("Att"), DateTimeOffset)
Console.WriteLine("dt={0}", dt)
```
This example produces the following output:
```
<Root Att="2006-10-06T12:30:00-07:00" />
dt=10/6/2006 12:30:00 PM -07:00
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.DateTimeOffset" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.DateTimeOffset}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator decimal (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Decimal op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Decimal" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Decimal" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator System::Decimal(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; decimal" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Decimal</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Decimal" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Decimal" />.</summary>
<returns>A <see cref="T:System.Decimal" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with a decimal value. It then retrieves the value of the attribute by casting to <xref:System.Decimal>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", "79228162514264337593543950335")
);
decimal value = (decimal)root.Attribute("Att");
Console.WriteLine("value={0}", value);
```
```vb
Dim root As XElement = <Root Att="79228162514264337593543950335"/>
Dim value As Decimal = CDec(root.Attribute("Att"))
Console.WriteLine("value={0}", value)
```
This example produces the following output:
```
value=79228162514264337593543950335
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Decimal" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Decimal}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator double (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname float64 op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Double" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator double(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; double" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Double" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Double" />.</summary>
<returns>A <see cref="T:System.Double" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with <xref:System.Double> content. It then retrieves the value by casting to <xref:System.Double>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 1.79769313486231e308)
);
double value = (double)root.Attribute("Att");
Console.WriteLine("value={0}", value);
```
```vb
Dim root As XElement = <Root Att="1.79769313486231E+308"/>
Dim value As Double = CDbl(root.Attribute("Att"))
Console.WriteLine("value={0}", value)
```
This example produces the following output:
```
value=1.79769313486231E+308
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Double" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Double}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Guid (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Guid op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Guid" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Guid" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Guid(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Guid" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Guid</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Guid" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Guid" />.</summary>
<returns>A <see cref="T:System.Guid" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with a GUID as content. It then retrieves the value by casting to <xref:System.Guid>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", new Guid("3c1cc55b-baff-4b7a-9d17-077af3aa5730"))
);
Guid value = (Guid)root.Attribute("Att");
Console.WriteLine("value={0}", value);
```
```vb
Dim root As XElement = <Root Att=<%= New Guid("3c1cc55b-baff-4b7a-9d17-077af3aa5730") %>/>
Dim value As Guid = CType(root.Attribute("Att"), Guid)
Console.WriteLine("value={0}", value)
```
This example produces the following output:
```
value=3c1cc55b-baff-4b7a-9d17-077af3aa5730
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Guid" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Guid}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator int (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname int32 op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Int32" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator int(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; int" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Int32" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to an <see cref="T:System.Int32" />.</summary>
<returns>A <see cref="T:System.Int32" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with an integer as content. It then retrieves the value by casting to <xref:System.Int32>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 2147483647)
);
int value = (int)root.Attribute("Att");
Console.WriteLine("value={0}", value);
```
```vb
Dim root As XElement = <Root Att="2147483647"/>
Dim value As Integer = CInt(root.Attribute("Att"))
Console.WriteLine("value={0}", value)
```
This example produces the following output:
```
value=2147483647
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Int32" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Int32}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator long (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname int64 op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Int64" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Long" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator long(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; int64" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int64</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Int64" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to an <see cref="T:System.Int64" />.</summary>
<returns>A <see cref="T:System.Int64" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with a long integer as content. It then retrieves the value of the attribute by casting to <xref:System.Int64>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 9223372036854775807)
);
long value = (long)root.Attribute("Att");
Console.WriteLine("value={0}", value);
```
```vb
Dim root As XElement = <Root Att="9223372036854775807"/>
Dim value As Long = CLng(root.Attribute("Att"))
Console.WriteLine("value={0}", value)
```
This example produces the following output:
```
value=9223372036854775807
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Int64" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Int64}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;bool&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;bool&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Boolean}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;bool&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;bool&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Boolean&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Nullable`1" /> of <see cref="T:System.Boolean" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Boolean" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.Boolean" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When converting to <xref:System.Boolean> from an attribute or element, allowed values are "0", "1", and any string that produces "true" or "false" after trimming and conversion to lower case.
## Examples
The following example creates an attribute with Boolean content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.Boolean>.
```csharp
XElement root = new XElement("Root",
new XAttribute("BoolValue1", true),
new XAttribute("BoolValue2", false)
);
bool? bool1 = (bool?)root.Attribute("BoolValue1");
bool? bool2 = (bool?)root.Attribute("BoolValue2");
Console.WriteLine("Nullable boolean: BoolValue1={0}", bool1);
Console.WriteLine("Nullable boolean: BoolValue2={0}", bool2);
```
```vb
Dim root As XElement = <Root BoolValue1="true" BoolValue2="false"/>
Dim bool1 As Nullable(Of Boolean) = CType(root.Attribute("BoolValue1"), Nullable(Of Boolean))
Dim bool2 As Nullable(Of Boolean) = CType(root.Attribute("BoolValue2"), Nullable(Of Boolean))
Console.WriteLine("Nullable boolean: BoolValue1={0}", bool1)
Console.WriteLine("Nullable boolean: BoolValue2={0}", bool2)
```
This example produces the following output:
```
Nullable boolean: BoolValue1=True
Nullable boolean: BoolValue2=False
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Boolean" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Boolean" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;DateTime&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;valuetype System.DateTime&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.DateTime}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of DateTime)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;DateTime&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;DateTime&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.DateTime&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.DateTime" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.DateTime" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.DateTime" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value space of an attribute or element that contains date and time content is closely related to the dates and times described in ISO 8601. When creating an attribute or element that contains date and time content, the attribute or element values are formatted per the W3C specification. See the W3C specification for more details.
Behavior is lax when casting to a <xref:System.Nullable%601> of <xref:System.DateTime> from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a <xref:System.Nullable%601> of <xref:System.DateTime>.
This conversion operator uses <xref:System.Globalization.CultureInfo.InvariantCulture%2A?displayProperty=nameWithType> to convert from a <xref:System.DateTime>.
## Examples
The following example creates an attribute with a date and time as content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.DateTime>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", new DateTime(2006, 10, 6, 12, 30, 0))
);
DateTime? value = (DateTime?)root.Attribute("Att");
Console.WriteLine("Nullable DateTime: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att=<%= New DateTime(2006, 10, 6, 12, 30, 0) %>/>
Dim value As Nullable(Of DateTime) = CType(root.Attribute("Att"), Nullable(Of DateTime))
Console.WriteLine("Nullable DateTime: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable DateTime: value=10/6/2006 12:30:00 PM
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.DateTime" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.DateTime" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;DateTimeOffset&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;valuetype System.DateTimeOffset&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.DateTimeOffset}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of DateTimeOffset)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;DateTimeOffset&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;DateTimeOffset&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.DateTimeOffset&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.DateTimeOffset" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.DateTimeOffset" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.DateTimeOffset" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This conversion operator uses the <xref:System.Xml.XmlConvert> class to do the conversion.
## Examples
The following example creates an attribute with a date and time as content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.DateTimeOffset>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", new DateTimeOffset(new DateTime(2006, 10, 6, 12, 30, 0)))
);
DateTimeOffset? value = (DateTimeOffset?)root.Attribute("Att");
Console.WriteLine("Nullable DateTimeOffset: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = _
<Root
Att=<%= New DateTimeOffset(New DateTime(2006, 10, 6, 12, 30, 0)) %>/>
Dim value As Nullable(Of DateTimeOffset) = CType(root.Attribute("Att"), Nullable(Of DateTimeOffset))
Console.WriteLine("Nullable DateTimeOffset: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable DateTimeOffset: value=10/6/2006 12:30:00 PM -07:00
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.DateTimeOffset" /> value.</exception>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;decimal&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;valuetype System.Decimal&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Decimal}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of Decimal)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;System::Decimal&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;decimal&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Decimal&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Nullable`1" /> of <see cref="T:System.Decimal" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Decimal" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.Decimal" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with decimal content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.Decimal>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", "79228162514264337593543950335")
);
decimal? value = (decimal?)root.Attribute("Att");
Console.WriteLine("Nullable decimal: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att="79228162514264337593543950335"/>
Dim value As Nullable(Of Decimal) = CType(root.Attribute("Att"), Nullable(Of Decimal))
Console.WriteLine("Nullable decimal: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable decimal: value=79228162514264337593543950335
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Decimal" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Decimal" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;double&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;float64&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Double}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;double&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;double&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Double&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Nullable`1" /> of <see cref="T:System.Double" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Double" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.Double" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with double precision floating point content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.Double>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 1.79769313486231e308)
);
double? value = (double?)root.Attribute("Att");
Console.WriteLine("Nullable double: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att="1.79769313486231E+308"/>
Dim value As Nullable(Of Double) = CType(root.Attribute("Att"), Nullable(Of Double))
Console.WriteLine("Nullable double: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable double: value=1.79769313486231E+308
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Double" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Double" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;Guid&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;valuetype System.Guid&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Guid}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of Guid)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;Guid&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;Guid&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Guid&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Guid" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Guid" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.Guid" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with guid content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.Guid>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", new Guid("3c1cc55b-baff-4b7a-9d17-077af3aa5730"))
);
Guid? value = (Guid?)root.Attribute("Att");
Console.WriteLine("Nullable Guid: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att=<%= New Guid("3c1cc55b-baff-4b7a-9d17-077af3aa5730") %>/>
Dim value As Nullable(Of Guid) = CType(root.Attribute("Att"), Nullable(Of Guid))
Console.WriteLine("Nullable Guid: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable Guid: value=3c1cc55b-baff-4b7a-9d17-077af3aa5730
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Guid" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Guid" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;int&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;int32&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Int32}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;int&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;int&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Int32&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Int32" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Int32" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.Int32" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with integer content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.Int32>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 2147483647)
);
int? value = (int?)root.Attribute("Att");
Console.WriteLine("Nullable int: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att="2147483647"/>
Dim value As Nullable(Of Integer) = CType(root.Attribute("Att"), Nullable(Of Integer))
Console.WriteLine("Nullable int: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable int: value=2147483647
```
]]></format>
</remarks>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Int32" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;long&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;int64&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Int64}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of Long)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;long&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;int64&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Int64&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Int64" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Int64" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.Int64" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with long integer content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.Int64>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 9223372036854775807)
);
long? value = (long?)root.Attribute("Att");
Console.WriteLine("Nullable long: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att="9223372036854775807"/>
Dim value As Nullable(Of Long) = CType(root.Attribute("Att"), Nullable(Of Long))
Console.WriteLine("Nullable long: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable long: value=9223372036854775807
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Int64" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Int64" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;float&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;float32&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Single}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of Single)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;float&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;single&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Single&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Nullable`1" /> of <see cref="T:System.Single" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.Single" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.Single" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with single precision floating point content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.Single>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 3.402823e38)
);
float? value = (float?)root.Attribute("Att");
Console.WriteLine("Nullable Single: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att="3.402823E+38"/>
Dim value As Nullable(Of Single) = CType(root.Attribute("Att"), Nullable(Of Single))
Console.WriteLine("Nullable Single: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable Single: value=3.402823E+38
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Single" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Single" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;TimeSpan&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;valuetype System.TimeSpan&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.TimeSpan}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of TimeSpan)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;TimeSpan&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;TimeSpan&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.TimeSpan&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.TimeSpan" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.TimeSpan" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.TimeSpan" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value space of an attribute or element that contains time span content is closely related to duration content as described in ISO 8601. When creating an attribute or element that contains time span content, the attribute or element values are formatted per the W3C specification. Please see the W3C specification for more details.
Behavior is lax when casting to a <xref:System.Nullable%601> of <xref:System.TimeSpan> from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a <xref:System.Nullable%601> of <xref:System.TimeSpan>.
## Examples
The following example creates an attribute with time span content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.TimeSpan>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", new TimeSpan(1, 5, 30))
);
TimeSpan? value = (TimeSpan?)root.Attribute("Att");
Console.WriteLine("Nullable TimeSpan: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att=<%= New TimeSpan(1, 5, 30) %>/>
Dim value As Nullable(Of TimeSpan) = CType(root.Attribute("Att"), Nullable(Of TimeSpan))
Console.WriteLine("Nullable TimeSpan: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable TimeSpan: value=01:05:30
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.TimeSpan" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.TimeSpan" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;uint&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;unsigned int32&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.UInt32}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of UInteger)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;System::UInt32&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;uint32&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.UInt32&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.UInt32" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.UInt32" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.UInt32" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with unsigned integer content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.UInt32>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 4294967295)
);
uint? value = (uint?)root.Attribute("Att");
Console.WriteLine("Nullable uint: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att="4294967295"/>
Dim value As Nullable(Of UInteger) = CType(root.Attribute("Att"), Nullable(Of UInteger))
Console.WriteLine("Nullable uint: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable uint: value=4294967295
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.UInt32" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.UInt32" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator Nullable&lt;ulong&gt; (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.Nullable`1&lt;unsigned int64&gt; op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.UInt64}" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Nullable(Of ULong)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator Nullable&lt;System::UInt64&gt;(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; Nullable&lt;uint64&gt;" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.UInt64&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.UInt64" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Nullable`1" /> of <see cref="T:System.UInt64" />.</summary>
<returns>A <see cref="T:System.Nullable`1" /> of <see cref="T:System.UInt64" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with unsigned long integer content. It then retrieves the value by casting to <xref:System.Nullable%601> of <xref:System.UInt64>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 9223372036854775807)
);
ulong? value = (ulong?)root.Attribute("Att");
Console.WriteLine("Nullable ulong: value={0}", value == null ? "null" : value.ToString());
```
```vb
Dim root As XElement = <Root Att="9223372036854775807"/>
Dim value As Nullable(Of ULong) = CType(root.Attribute("Att"), Nullable(Of ULong))
Console.WriteLine("Nullable ulong: value={0}", IIf(value.HasValue, value.ToString(), "null"))
```
This example produces the following output:
```
Nullable ulong: value=9223372036854775807
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.UInt64" /> value.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.UInt64" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator float (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname float32 op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Single" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As Single" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator float(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; single" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Single</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.Single" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.Single" />.</summary>
<returns>A <see cref="T:System.Single" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with single precision floating point content. It then retrieves the value by casting to <xref:System.Single>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 3.402823e38)
);
float value = (float)root.Attribute("Att");
Console.WriteLine("value={0}", value);
```
```vb
Dim root As XElement = <Root Att="3.402823E+38"/>
Dim value As Single = CSng(root.Attribute("Att"))
Console.WriteLine("value={0}", value)
```
This example produces the following output:
```
value=3.402823E+38
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.Single" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.Single}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator string (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname string op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.String" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator System::String ^(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; string" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.String" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.String" />.</summary>
<returns>A <see cref="T:System.String" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with string content. It then retrieves the value by casting to <xref:System.String>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", "attribute content")
);
XAttribute att = root.Attribute("Att");
string str = (string)att;
Console.WriteLine("(string)att={0}", str);
```
```vb
Dim root As XElement = <Root Att="attribute content"/>
Dim att As XAttribute = root.Attribute("Att")
Dim str As String = CStr(att)
Console.WriteLine("(string)att={0}", str)
```
This example produces the following output:
```
(string)att=attribute content
```
]]></format>
</remarks>
<altmember cref="M:System.Xml.Linq.XAttribute.ToString" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator TimeSpan (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.TimeSpan op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.TimeSpan" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As TimeSpan" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator TimeSpan(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; TimeSpan" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.TimeSpan</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.TimeSpan" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.TimeSpan" />.</summary>
<returns>A <see cref="T:System.TimeSpan" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value space of an attribute or element that contains time span content is closely related to duration content as described in ISO 8601. When creating an attribute or element that contains time span content, the attribute or element values are formatted per the W3C specification. Please see the W3C specification for more details.
Behavior is lax when casting to a <xref:System.TimeSpan> from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a <xref:System.TimeSpan>.
## Examples
The following example creates an attribute with time span content. It then retrieves the value by casting to <xref:System.TimeSpan>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", new TimeSpan(1, 5, 30))
);
TimeSpan value = (TimeSpan)root.Attribute("Att");
Console.WriteLine("value={0}", value);
```
```vb
Dim root As XElement = <Root Att=<%= New TimeSpan(1, 5, 30) %>/>
Dim value As TimeSpan = CType(root.Attribute("Att"), TimeSpan)
Console.WriteLine("value={0}", value)
```
This example produces the following output:
```
value=01:05:30
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.TimeSpan" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.TimeSpan}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator uint (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname unsigned int32 op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.UInt32" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As UInteger" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator System::UInt32(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; uint32" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.UInt32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.UInt32" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.UInt32" />.</summary>
<returns>A <see cref="T:System.UInt32" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with unsigned integer content. It then retrieves the value by casting to <xref:System.UInt32>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 4294967295)
);
uint value = (uint)root.Attribute("Att");
Console.WriteLine("value={0}", value);
```
```vb
Dim root As XElement = <Root Att="4294967295"/>
Dim value As UInteger = CUInt(root.Attribute("Att"))
Console.WriteLine("value={0}", value)
```
This example produces the following output:
```
value=4294967295
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.UInt32" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.UInt32}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="op_Explicit">
<MemberSignature Language="C#" Value="public static explicit operator ulong (System.Xml.Linq.XAttribute attribute);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname unsigned int64 op_Explicit(class System.Xml.Linq.XAttribute attribute) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.UInt64" />
<MemberSignature Language="VB.NET" Value="Public Shared Narrowing Operator CType (attribute As XAttribute) As ULong" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static explicit operator System::UInt64(System::Xml::Linq::XAttribute ^ attribute);" />
<MemberSignature Language="F#" Value="static member op_Explicit : System.Xml.Linq.XAttribute -&gt; uint64" Usage="System.Xml.Linq.XAttribute.op_Explicit attribute" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.UInt64</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="attribute" Type="System.Xml.Linq.XAttribute" />
</Parameters>
<Docs>
<param name="attribute">The <see cref="T:System.Xml.Linq.XAttribute" /> to cast to <see cref="T:System.UInt64" />.</param>
<summary>Cast the value of this <see cref="T:System.Xml.Linq.XAttribute" /> to a <see cref="T:System.UInt64" />.</summary>
<returns>A <see cref="T:System.UInt64" /> that contains the content of this <see cref="T:System.Xml.Linq.XAttribute" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[## Examples
The following example creates an attribute with unsigned long integer content. It then retrieves the value by casting to <xref:System.UInt64>.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", 1844674407370955161)
);
ulong value = (ulong)root.Attribute("Att");
Console.WriteLine("value={0}", value);
```
```vb
Dim root As XElement = <Root Att="1844674407370955161"/>
Dim value As ULong = CULng(root.Attribute("Att"))
Console.WriteLine("value={0}", value)
```
This example produces the following output:
```
value=1844674407370955161
```
]]></format>
</remarks>
<exception cref="T:System.FormatException">The attribute does not contain a valid <see cref="T:System.UInt64" /> value.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="attribute" /> parameter is <see langword="null" />.</exception>
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.Nullable{System.UInt64}" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="PreviousAttribute">
<MemberSignature Language="C#" Value="public System.Xml.Linq.XAttribute PreviousAttribute { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Xml.Linq.XAttribute PreviousAttribute" />
<MemberSignature Language="DocId" Value="P:System.Xml.Linq.XAttribute.PreviousAttribute" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property PreviousAttribute As XAttribute" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Xml::Linq::XAttribute ^ PreviousAttribute { System::Xml::Linq::XAttribute ^ get(); };" />
<MemberSignature Language="F#" Value="member this.PreviousAttribute : System.Xml.Linq.XAttribute" Usage="System.Xml.Linq.XAttribute.PreviousAttribute" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.Linq.XAttribute</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the previous attribute of the parent element.</summary>
<value>An <see cref="T:System.Xml.Linq.XAttribute" /> containing the previous attribute of the parent element.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Attributes are maintained in the XML tree in the order that they were added to the element. When a collection of attributes is returned by <xref:System.Xml.Linq.XElement.Attributes%2A>, they are returned in the order that they were added, and are not sorted. When you request the previous attribute through this property, this property returns the attribute that was added before this attribute.
If this attribute does not have a parent, or if this attribute is the first attribute, then this property returns `null`.
The <xref:System.Xml.Linq.XElement> class stores its attributes as a singly-linked list of <xref:System.Xml.Linq.XAttribute> objects. This means that the <xref:System.Xml.Linq.XAttribute.PreviousAttribute%2A> property must traverse the list of attributes that belong to the element. Therefore, using this property might affect your performance.
## Examples
The following example shows how to iterate through the attributes of an element using this property.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att1", 1),
new XAttribute("Att2", 2),
new XAttribute("Att3", 3),
new XAttribute("Att4", 4)
);
XAttribute att = root.LastAttribute;
do {
Console.WriteLine(att);
}
while((att = att.PreviousAttribute) != null);
```
```vb
Dim root As XElement = <Root Att1="1" Att2="2" Att3="3" Att4="4"/>
Dim att As XAttribute = root.LastAttribute
Dim val As Boolean = True
Do
Console.WriteLine(att)
att = att.PreviousAttribute
Loop While (Not (att Is Nothing))
```
This example produces the following output:
```
Att4="4"
Att3="3"
Att2="2"
Att1="1"
```
]]></format>
</remarks>
<altmember cref="P:System.Xml.Linq.XAttribute.NextAttribute" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="Remove">
<MemberSignature Language="C#" Value="public void Remove ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Remove() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.Remove" />
<MemberSignature Language="VB.NET" Value="Public Sub Remove ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Remove();" />
<MemberSignature Language="F#" Value="member this.Remove : unit -&gt; unit" Usage="xAttribute.Remove " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Removes this attribute from its parent element.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this method to modify an XML tree. This method will cause events to occur.
There are many scenarios in which you might want to remove a set of attributes. In [!INCLUDE[sqltecxlinq](~/includes/sqltecxlinq-md.md)] programming, you should not manipulate or modify a set of nodes while you are querying for nodes in that set. In practical terms, this means that you should not iterate over a set of attributes and remove them. Instead, you should materialize them into a <xref:System.Collections.Generic.List%601> using the <xref:System.Linq.Enumerable.ToList%2A> extension method. Then you can iterate over the list, removing the attributes. For more information, see [Mixed Declarative Code/Imperative Code Bugs (LINQ to XML)](https://msdn.microsoft.com/library/d9a5c404-2b0e-46cd-a358-0e78773b3094).
Alternatively, if you want to remove a set of attributes, it is recommended that you use the <xref:System.Xml.Linq.Extensions.Remove%2A?displayProperty=nameWithType> method. This method copies the attributes to a list, then iterates over the list, removing the attributes.
## Examples
The following example creates an element with three attributes. It then removes one of the attributes.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att1", "content1"),
new XAttribute("Att2", "content2"),
new XAttribute("Att3", "content3")
);
XAttribute att = root.Attribute("Att2");
att.Remove();
Console.WriteLine(root);
```
```vb
Dim root As XElement = <Root Att1="content1" Att2="content2" Att3="content3"/>
Dim att As XAttribute = root.Attribute("Att2")
att.Remove()
Console.WriteLine(root)
```
This example produces the following output:
```
<Root Att1="content1" Att3="content3" />
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The parent element is <see langword="null" />.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="SetValue">
<MemberSignature Language="C#" Value="public void SetValue (object value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetValue(object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.SetValue(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Sub SetValue (value As Object)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void SetValue(System::Object ^ value);" />
<MemberSignature Language="F#" Value="member this.SetValue : obj -&gt; unit" Usage="xAttribute.SetValue value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="value">The value to assign to this attribute.</param>
<summary>Sets the value of this attribute.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value is converted to its string representation and assigned to the <xref:System.Xml.Linq.XAttribute.Value%2A> property.
It is invalid to pass an instance of a class that derives from <xref:System.Xml.Linq.XObject>, such as <xref:System.Xml.Linq.XElement> or <xref:System.Xml.Linq.XAttribute>.
This method will raise the <xref:System.Xml.Linq.XObject.Changed> and the <xref:System.Xml.Linq.XObject.Changing> events.
## Examples
The following example creates an element with several attributes. It then changes the contents of one of the attributes.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att1", "content1"),
new XAttribute("Att2", "content2"),
new XAttribute("Att3", "content3")
);
XAttribute att = root.Attribute("Att2");
att.SetValue("new content");
Console.WriteLine(root);
```
```vb
Dim root As XElement = <Root Att1="content1" Att2="content2" Att3="content3"/>
Dim att As XAttribute = root.Attribute("Att2")
att.SetValue("new content")
Console.WriteLine(root)
```
This example produces the following output:
```
<Root Att1="content1" Att2="new content" Att3="content3" />
```
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="value" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="value" /> is an <see cref="T:System.Xml.Linq.XObject" />.</exception>
<altmember cref="M:System.Xml.Linq.XElement.SetValue(System.Object)" />
<altmember cref="M:System.Xml.Linq.XElement.SetAttributeValue(System.Xml.Linq.XName,System.Object)" />
<altmember cref="M:System.Xml.Linq.XElement.SetElementValue(System.Xml.Linq.XName,System.Object)" />
<altmember cref="P:System.Xml.Linq.XAttribute.Value" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="ToString">
<MemberSignature Language="C#" Value="public override string ToString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Linq.XAttribute.ToString" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ToString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::String ^ ToString();" />
<MemberSignature Language="F#" Value="override this.ToString : unit -&gt; string" Usage="xAttribute.ToString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Converts the current <see cref="T:System.Xml.Linq.XAttribute" /> object to a string representation.</summary>
<returns>A <see cref="T:System.String" /> containing the XML text representation of an attribute and its value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method returns a string in the form of `AttributeName="content"`.
> [!WARNING]
> When this method is called and <xref:System.Xml.Linq.XAttribute> contains control character, an exception is thrown with a message like: hexadecimal value 0x0B, is an invalid character.
## Examples
The following example creates an element with several attributes. It then gets an attribute and displays it and its content by calling this method.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att1", "content1"),
new XAttribute("Att2", "content2"),
new XAttribute("Att3", "content3")
);
XAttribute att = root.Attribute("Att2");
Console.WriteLine(att.ToString());
```
```vb
Dim root As XElement = <Root Att1="content1" Att2="content2" Att3="content3"/>
Dim att As XAttribute = root.Attribute("Att2")
Console.WriteLine(att.ToString())
```
This example produces the following output:
```
Att2="content2"
```
]]></format>
</remarks>
<altmember cref="P:System.Xml.Linq.XAttribute.Name" />
<altmember cref="P:System.Xml.Linq.XAttribute.Value" />
<altmember cref="M:System.Xml.Linq.XAttribute.op_Explicit(System.Xml.Linq.XAttribute)~System.String" />
<related type="Article" href="https://msdn.microsoft.com/library/f0fe21e9-ee43-4a55-b91a-0800e5782c13">LINQ to XML</related>
</Docs>
</Member>
<Member MemberName="Value">
<MemberSignature Language="C#" Value="public string Value { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Value" />
<MemberSignature Language="DocId" Value="P:System.Xml.Linq.XAttribute.Value" />
<MemberSignature Language="VB.NET" Value="Public Property Value As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Value { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Value : string with get, set" Usage="System.Xml.Linq.XAttribute.Value" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.XDocument</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.Linq</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the value of this attribute.</summary>
<value>A <see cref="T:System.String" /> containing the value of this attribute.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this property to get or set the value of an attribute.
Setting this property will raise the <xref:System.Xml.Linq.XObject.Changed> and the <xref:System.Xml.Linq.XObject.Changing> events.
If you are getting the value and the attribute might not exist, it is more convenient to use the explicit conversion operators, and assign the attribute to a nullable type such as `string` or <xref:System.Nullable%601> of <xref:System.Int32>. If the attribute does not exist, then the nullable type is set to `null`. Before using this property, you must make sure that the <xref:System.Xml.Linq.XElement.Attribute%2A> method does not return `null`.
## Examples
The following example creates an element with an attribute. It then retrieves the value of the attribute, and then sets it.
Note that the Visual Basic example uses the XML attribute property.
```csharp
XElement root = new XElement("Root",
new XAttribute("Att", "content")
);
XAttribute att = root.FirstAttribute;
Console.WriteLine(att.Value);
att.Value = "new text";
Console.WriteLine(att.Value);
```
```vb
Dim root As XElement = <Root Att="content"/>
Console.WriteLine(root.@Att)
root.@Att = "new text"
Console.WriteLine(root.@Att)
```
This example produces the following output:
```
content
new text
```
The following example shows the benefit of using the explicit conversion operators to get the value of an attribute that might not exist:
```csharp