XmlAnyElementAttribute Constructors

Definition

Initializes a new instance of the XmlAnyElementAttribute class.

Overloads

XmlAnyElementAttribute()

Initializes a new instance of the XmlAnyElementAttribute class.

XmlAnyElementAttribute(String)

Initializes a new instance of the XmlAnyElementAttribute class and specifies the XML element name generated in the XML document.

XmlAnyElementAttribute(String, String)

Initializes a new instance of the XmlAnyElementAttribute class and specifies the XML element name generated in the XML document and its XML namespace.

XmlAnyElementAttribute()

Source:
XmlAnyElementAttribute.cs
Source:
XmlAnyElementAttribute.cs
Source:
XmlAnyElementAttribute.cs

Initializes a new instance of the XmlAnyElementAttribute class.

C#
public XmlAnyElementAttribute();

Remarks

Use the XmlAnyElementAttribute constructor when you are overriding the serialization of a field. For more details about overriding serialization, see the XmlAttributeOverrides class.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

XmlAnyElementAttribute(String)

Source:
XmlAnyElementAttribute.cs
Source:
XmlAnyElementAttribute.cs
Source:
XmlAnyElementAttribute.cs

Initializes a new instance of the XmlAnyElementAttribute class and specifies the XML element name generated in the XML document.

C#
public XmlAnyElementAttribute(string name);
C#
public XmlAnyElementAttribute(string? name);

Parameters

name
String

The name of the XML element that the XmlSerializer generates.

Remarks

Use the XmlAnyElementAttribute constructor when you are overriding the serialization of a field. For more details about overriding serialization, see the XmlAttributeOverrides class.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

XmlAnyElementAttribute(String, String)

Source:
XmlAnyElementAttribute.cs
Source:
XmlAnyElementAttribute.cs
Source:
XmlAnyElementAttribute.cs

Initializes a new instance of the XmlAnyElementAttribute class and specifies the XML element name generated in the XML document and its XML namespace.

C#
public XmlAnyElementAttribute(string name, string ns);
C#
public XmlAnyElementAttribute(string? name, string? ns);

Parameters

name
String

The name of the XML element that the XmlSerializer generates.

ns
String

The XML namespace of the XML element.

Remarks

Use the XmlAnyElementAttribute constructor when you are overriding the serialization of a field. For more details about overriding serialization, see the XmlAttributeOverrides class.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0