## XmlSerializer::Serialize(System::SharedPtr\<IO::Stream\>, System::SharedPtr\<Object\>) method


将文档序列化为 XML。

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<IO::Stream> stream, System::SharedPtr<Object> o)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 流 | System::SharedPtr\<IO::Stream\> | 目标流。 |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) 用于序列化。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Stream](../../../system.io/stream/)
* Class [Object](../../../system/object/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.Font for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<IO::Stream\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>) method


将文档序列化为 XML。

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<IO::Stream> stream, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 流 | System::SharedPtr\<IO::Stream\> | 目标流。 |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) 用于序列化。 |
| 命名空间 | System::SharedPtr\<XmlSerializerNamespaces\> | 命名空间存储。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Stream](../../../system.io/stream/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.Font for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<IO::TextWriter\>, System::SharedPtr\<Object\>) method


将文档序列化为 XML。

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<IO::TextWriter> textWriter, System::SharedPtr<Object> o)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| textWriter | System::SharedPtr\<IO::TextWriter\> | 目标流。 |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) 用于序列化。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [TextWriter](../../../system.io/textwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.Font for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<IO::TextWriter\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>) method


将文档序列化为 XML。

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<IO::TextWriter> textWriter, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| textWriter | System::SharedPtr\<IO::TextWriter\> | 目标流。 |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) 用于序列化。 |
| 命名空间 | System::SharedPtr\<XmlSerializerNamespaces\> | 命名空间存储。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [TextWriter](../../../system.io/textwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.Font for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<XmlWriter\>, System::SharedPtr\<Object\>) method


将文档序列化为 XML。

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<XmlWriter> xmlWriter, System::SharedPtr<Object> o)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| xmlWriter | System::SharedPtr\<XmlWriter\> | 目标流。 |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) 用于序列化。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [XmlWriter](../../../system.xml/xmlwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.Font for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<XmlWriter\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>) method


将文档序列化为 XML。

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<XmlWriter> xmlWriter, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| xmlWriter | System::SharedPtr\<XmlWriter\> | 目标流。 |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) 用于序列化。 |
| 命名空间 | System::SharedPtr\<XmlSerializerNamespaces\> | 命名空间存储。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [XmlWriter](../../../system.xml/xmlwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.Font for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<XmlWriter\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>, String) method


将文档序列化为 XML。

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<XmlWriter> xmlWriter, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces, String encodingStyle)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| xmlWriter | System::SharedPtr\<XmlWriter\> | 目标流。 |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) 用于序列化。 |
| 命名空间 | System::SharedPtr\<XmlSerializerNamespaces\> | 命名空间存储。 |
| encodingStyle | String | 序列化对象时使用的样式。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [XmlWriter](../../../system.xml/xmlwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [String](../../../system/string/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.Font for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<XmlWriter\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>, String, String) method


将文档序列化为 XML。

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<XmlWriter> xmlWriter, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces, String encodingStyle, String id)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| xmlWriter | System::SharedPtr\<XmlWriter\> | 目标流。 |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) 用于序列化。 |
| 命名空间 | System::SharedPtr\<XmlSerializerNamespaces\> | 命名空间存储。 |
| encodingStyle | String | 序列化对象时使用的样式。 |
| id | String | 在序列化时使用的[Object](../../../system/object/) 标识。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [XmlWriter](../../../system.xml/xmlwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [String](../../../system/string/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.Font for C++](../../../)
