XmlObjectSerializer.WriteObjectContent Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Csak egy objektum tartalmát írja egy XML-dokumentumba vagy streambe.
Túlterhelések
| Name | Description |
|---|---|
| WriteObjectContent(XmlDictionaryWriter, Object) |
Csak az objektum tartalmának írása az XML-dokumentumba vagy streamelés a megadott XmlDictionaryWriterhasználatával. |
| WriteObjectContent(XmlWriter, Object) |
Csak az objektum tartalmát írja be az XML-dokumentumba vagy a megadott XmlWriteradatfolyamba. |
Megjegyzések
A WriteStartObject, WriteObjectContentés WriteEndObject metódusokat végre kell hajtani. A három módszer egymás után a teljes szerializálás megírására szolgál a mintával: írás kezdete, tartalom írása és írás vége. Ha az implementáció XML-elemekkel ír, attribútumokat szúrhat be az objektum tartalmának írása előtt. A három metódust a metódus virtuális implementációja is meghívja WriteObject .
WriteObjectContent(XmlDictionaryWriter, Object)
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
Csak az objektum tartalmának írása az XML-dokumentumba vagy streamelés a megadott XmlDictionaryWriterhasználatával.
public:
abstract void WriteObjectContent(System::Xml::XmlDictionaryWriter ^ writer, System::Object ^ graph);
public abstract void WriteObjectContent(System.Xml.XmlDictionaryWriter writer, object graph);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public abstract void WriteObjectContent(System.Xml.XmlDictionaryWriter writer, object? graph);
public abstract void WriteObjectContent(System.Xml.XmlDictionaryWriter writer, object? graph);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public abstract void WriteObjectContent(System.Xml.XmlDictionaryWriter writer, object? graph);
abstract member WriteObjectContent : System.Xml.XmlDictionaryWriter * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
abstract member WriteObjectContent : System.Xml.XmlDictionaryWriter * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
abstract member WriteObjectContent : System.Xml.XmlDictionaryWriter * obj -> unit
Public MustOverride Sub WriteObjectContent (writer As XmlDictionaryWriter, graph As Object)
Paraméterek
- writer
- XmlDictionaryWriter
Az XmlDictionaryWriter XML-dokumentum vagy -stream írásához használt.
- graph
- Object
Az írandó tartalmat tartalmazó objektum.
- Attribútumok
Kivételek
a szerializált típus nem felel meg az adatszerződés szabályainak. Az attribútum például DataContractAttribute nem lett alkalmazva a típusra.
probléma merült fel a szerializált példánysal kapcsolatban.
túllépte a szerializálandó objektumok maximális számát. Ellenőrizze a MaxItemsInObjectGraph tulajdonságot.
A következőre érvényes:
WriteObjectContent(XmlWriter, Object)
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
Csak az objektum tartalmát írja be az XML-dokumentumba vagy a megadott XmlWriteradatfolyamba.
public:
virtual void WriteObjectContent(System::Xml::XmlWriter ^ writer, System::Object ^ graph);
public virtual void WriteObjectContent(System.Xml.XmlWriter writer, object graph);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public virtual void WriteObjectContent(System.Xml.XmlWriter writer, object? graph);
public virtual void WriteObjectContent(System.Xml.XmlWriter writer, object? graph);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public virtual void WriteObjectContent(System.Xml.XmlWriter writer, object? graph);
abstract member WriteObjectContent : System.Xml.XmlWriter * obj -> unit
override this.WriteObjectContent : System.Xml.XmlWriter * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
abstract member WriteObjectContent : System.Xml.XmlWriter * obj -> unit
override this.WriteObjectContent : System.Xml.XmlWriter * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
abstract member WriteObjectContent : System.Xml.XmlWriter * obj -> unit
override this.WriteObjectContent : System.Xml.XmlWriter * obj -> unit
Public Overridable Sub WriteObjectContent (writer As XmlWriter, graph As Object)
Paraméterek
- graph
- Object
Az írandó tartalmat tartalmazó objektum.
- Attribútumok
Kivételek
a szerializált típus nem felel meg az adatszerződés szabályainak. Az attribútum például DataContractAttribute nem lett alkalmazva a típusra.
probléma merült fel a szerializált példánysal kapcsolatban.
túllépte a szerializálandó objektumok maximális számát. Ellenőrizze a MaxItemsInObjectGraph tulajdonságot.