XmlObjectSerializer.WriteObject 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.
Az összes objektumadatot (kezdő XML-elemet, tartalmat és záró elemet) egy XML-dokumentumba vagy streambe írja.
Túlterhelések
| Name | Description |
|---|---|
| WriteObject(Stream, Object) |
Az objektum teljes tartalmát (kezdését, tartalmát és végét) a megadott StreamXML-dokumentumba vagy streambe írja. |
| WriteObject(XmlDictionaryWriter, Object) |
Az objektum teljes tartalmát (kezdését, tartalmát és végét) a megadott XmlDictionaryWriterXML-dokumentumba vagy streambe írja. |
| WriteObject(XmlWriter, Object) |
Az objektum teljes tartalmát (kezdését, tartalmát és végét) a megadott XmlWriterXML-dokumentumba vagy streambe írja. |
WriteObject(Stream, Object)
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
Az objektum teljes tartalmát (kezdését, tartalmát és végét) a megadott StreamXML-dokumentumba vagy streambe írja.
public:
virtual void WriteObject(System::IO::Stream ^ stream, System::Object ^ graph);
public virtual void WriteObject(System.IO.Stream stream, 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 WriteObject(System.IO.Stream stream, object? graph);
public virtual void WriteObject(System.IO.Stream stream, 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 WriteObject(System.IO.Stream stream, object? graph);
abstract member WriteObject : System.IO.Stream * obj -> unit
override this.WriteObject : System.IO.Stream * 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 WriteObject : System.IO.Stream * obj -> unit
override this.WriteObject : System.IO.Stream * 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 WriteObject : System.IO.Stream * obj -> unit
override this.WriteObject : System.IO.Stream * obj -> unit
Public Overridable Sub WriteObject (stream As Stream, graph As Object)
Paraméterek
- graph
- Object
A streambe írni kívánt adatokat 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:
WriteObject(XmlDictionaryWriter, Object)
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
Az objektum teljes tartalmát (kezdését, tartalmát és végét) a megadott XmlDictionaryWriterXML-dokumentumba vagy streambe írja.
public:
virtual void WriteObject(System::Xml::XmlDictionaryWriter ^ writer, System::Object ^ graph);
public virtual void WriteObject(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 virtual void WriteObject(System.Xml.XmlDictionaryWriter writer, object? graph);
public virtual void WriteObject(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 virtual void WriteObject(System.Xml.XmlDictionaryWriter writer, object? graph);
abstract member WriteObject : System.Xml.XmlDictionaryWriter * obj -> unit
override this.WriteObject : 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 WriteObject : System.Xml.XmlDictionaryWriter * obj -> unit
override this.WriteObject : 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 WriteObject : System.Xml.XmlDictionaryWriter * obj -> unit
override this.WriteObject : System.Xml.XmlDictionaryWriter * obj -> unit
Public Overridable Sub WriteObject (writer As XmlDictionaryWriter, graph As Object)
Paraméterek
- writer
- XmlDictionaryWriter
A XmlDictionaryWriter tartalom XML-dokumentumba vagy streambe való írására szolgál.
- 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.
Megjegyzések
Ez egy virtuális módszer, és egy alapértelmezett implementációval rendelkezik, amely meghívja a , WriteStartObjectés WriteObjectContent metódusokatWriteEndObject. Emiatt ez a módszer a szerializáló leggyakrabban használt módszere.
A következőre érvényes:
WriteObject(XmlWriter, Object)
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
- Forrás:
- XmlObjectSerializer.cs
Az objektum teljes tartalmát (kezdését, tartalmát és végét) a megadott XmlWriterXML-dokumentumba vagy streambe írja.
public:
virtual void WriteObject(System::Xml::XmlWriter ^ writer, System::Object ^ graph);
public virtual void WriteObject(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 WriteObject(System.Xml.XmlWriter writer, object? graph);
public virtual void WriteObject(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 WriteObject(System.Xml.XmlWriter writer, object? graph);
abstract member WriteObject : System.Xml.XmlWriter * obj -> unit
override this.WriteObject : 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 WriteObject : System.Xml.XmlWriter * obj -> unit
override this.WriteObject : 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 WriteObject : System.Xml.XmlWriter * obj -> unit
override this.WriteObject : System.Xml.XmlWriter * obj -> unit
Public Overridable Sub WriteObject (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.
Megjegyzések
Ez egy virtuális módszer, és egy alapértelmezett implementációval rendelkezik, amely delegálja az írást a XmlObjectSerializer.WriteObject(XmlDictionaryWriter, Object) túlterhelésbe.