XmlSerializationWriter.WriteSerializable Method

Definition

Instructs XmlNode to write an object that uses custom XML formatting as an XML element.

Overloads

WriteSerializable(IXmlSerializable, String, String, Boolean)

This API supports the product infrastructure and is not intended to be used directly from your code.

Writes an object that uses custom XML formatting as an XML element.

WriteSerializable(IXmlSerializable, String, String, Boolean, Boolean)

This API supports the product infrastructure and is not intended to be used directly from your code.

Instructs XmlNode to write an object that uses custom XML formatting as an XML element.

WriteSerializable(IXmlSerializable, String, String, Boolean)

Source:
XmlSerializationWriter.cs
Source:
XmlSerializationWriter.cs
Source:
XmlSerializationWriter.cs

Writes an object that uses custom XML formatting as an XML element.

This API supports the product infrastructure and is not intended to be used directly from your code.

C#
protected void WriteSerializable(System.Xml.Serialization.IXmlSerializable? serializable, string name, string ns, bool isNullable);
C#
protected void WriteSerializable(System.Xml.Serialization.IXmlSerializable serializable, string name, string ns, bool isNullable);

Parameters

serializable
IXmlSerializable

An object that implements the IXmlSerializable interface that uses custom XML formatting.

name
String

The local name of the XML element to write.

ns
String

The namespace of the XML element to write.

isNullable
Boolean

true to write an xsi:nil='true' attribute if the IXmlSerializable class object is null; otherwise, false.

Remarks

The protected members of XmlSerializationWriter are intended for use only by derived classes that are used internally within the .NET Framework XML serialization infrastructure.

Applies to

.NET 10 and other versions
Product Versions
.NET 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

WriteSerializable(IXmlSerializable, String, String, Boolean, Boolean)

Source:
XmlSerializationWriter.cs
Source:
XmlSerializationWriter.cs
Source:
XmlSerializationWriter.cs

Instructs XmlNode to write an object that uses custom XML formatting as an XML element.

This API supports the product infrastructure and is not intended to be used directly from your code.

C#
protected void WriteSerializable(System.Xml.Serialization.IXmlSerializable? serializable, string name, string? ns, bool isNullable, bool wrapped);
C#
protected void WriteSerializable(System.Xml.Serialization.IXmlSerializable serializable, string name, string ns, bool isNullable, bool wrapped);

Parameters

serializable
IXmlSerializable

An object that implements the IXmlSerializable interface that uses custom XML formatting.

name
String

The local name of the XML element to write.

ns
String

The namespace of the XML element to write.

isNullable
Boolean

true to write an xsi:nil='true' attribute if the IXmlSerializable object is null; otherwise, false.

wrapped
Boolean

true to ignore writing the opening element tag; otherwise, false to write the opening element tag.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 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