XmlSerializerSerialize(TextWriter, Object, XmlSerializationOptions) Method
Serializes the object passed in
obj by the provided
TextWriter object.
Namespace: KGySoft.Serialization.XmlAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
public static void Serialize(
TextWriter writer,
Object? obj,
XmlSerializationOptions options = XmlSerializationOptions.CompactSerializationOfPrimitiveArrays|XmlSerializationOptions.EscapeNewlineCharacters
)
Public Shared Sub Serialize (
writer As TextWriter,
obj As Object,
Optional options As XmlSerializationOptions = XmlSerializationOptions.CompactSerializationOfPrimitiveArrays Or XmlSerializationOptions.EscapeNewlineCharacters
)
public:
static void Serialize(
TextWriter^ writer,
Object^ obj,
XmlSerializationOptions options = XmlSerializationOptions::CompactSerializationOfPrimitiveArrays|XmlSerializationOptions::EscapeNewlineCharacters
)
static member Serialize :
writer : TextWriter *
obj : Object *
?options : XmlSerializationOptions
(* Defaults:
let _options = defaultArg options XmlSerializationOptions.CompactSerializationOfPrimitiveArrays|XmlSerializationOptions.EscapeNewlineCharacters
*)
-> unit
Parameters
- writer TextWriter
- A TextWriter implementation (for example, a StringWriter) that will be used for serialization.
The writer will not be closed after serialization.
- obj Object
- The Object to serialize.
- options XmlSerializationOptions (Optional)
- Options for serialization. This parameter is optional.
Default value: CompactSerializationOfPrimitiveArrays, EscapeNewlineCharacters