XmlObjectSerializer.WriteStartObject Yöntem

Tanım

Bir XML belgesine veya akışına yalnızca başlangıç XML öğesini yazar.

Aşırı Yüklemeler

Name Description
WriteStartObject(XmlDictionaryWriter, Object)

Belirtilen XmlDictionaryWriteröğesini kullanarak nesnenin verilerinin başlangıcını bir açılış XML öğesi olarak yazar.

WriteStartObject(XmlWriter, Object)

Belirtilen XmlWriteröğesini kullanarak nesnenin verilerinin başlangıcını bir açılış XML öğesi olarak yazar.

Açıklamalar

WriteStartObject, WriteObjectContentve WriteEndObject yöntemleri uygulanmalıdır. Üç yöntem, desen kullanılarak tam serileştirmeyi yazmak için sırayla kullanılır: yazma başlangıcı, yazma içeriği ve yazma sonu. Uygulama XML öğelerini kullanarak yazıyorsa, nesnenin içeriğini yazmadan önce öznitelikler eklenebilir. Üç yöntem, yönteminin sanal uygulaması tarafından da çağrılır WriteObject .

WriteStartObject(XmlDictionaryWriter, Object)

Kaynak:
XmlObjectSerializer.cs
Kaynak:
XmlObjectSerializer.cs
Kaynak:
XmlObjectSerializer.cs
Kaynak:
XmlObjectSerializer.cs
Kaynak:
XmlObjectSerializer.cs

Belirtilen XmlDictionaryWriteröğesini kullanarak nesnenin verilerinin başlangıcını bir açılış XML öğesi olarak yazar.

public:
 abstract void WriteStartObject(System::Xml::XmlDictionaryWriter ^ writer, System::Object ^ graph);
public abstract void WriteStartObject(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 WriteStartObject(System.Xml.XmlDictionaryWriter writer, object? graph);
public abstract void WriteStartObject(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 WriteStartObject(System.Xml.XmlDictionaryWriter writer, object? graph);
abstract member WriteStartObject : 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 WriteStartObject : 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 WriteStartObject : System.Xml.XmlDictionaryWriter * obj -> unit
Public MustOverride Sub WriteStartObject (writer As XmlDictionaryWriter, graph As Object)

Parametreler

writer
XmlDictionaryWriter

XmlDictionaryWriter XML belgesini yazmak için kullanılan.

graph
Object

Serileştirecek nesne.

Öznitelikler

Özel durumlar

seri hale getirilen tür, veri sözleşmesi kurallarına uymuyor. Örneğin, DataContractAttribute özniteliği türüne uygulanmadı.

örneğin serileştirilmesiyle ilgili bir sorun var.

serileştirilen nesne sayısı üst sınırı aşıldı. MaxItemsInObjectGraph özelliğini denetleyin.

Şunlara uygulanır

WriteStartObject(XmlWriter, Object)

Kaynak:
XmlObjectSerializer.cs
Kaynak:
XmlObjectSerializer.cs
Kaynak:
XmlObjectSerializer.cs
Kaynak:
XmlObjectSerializer.cs
Kaynak:
XmlObjectSerializer.cs

Belirtilen XmlWriteröğesini kullanarak nesnenin verilerinin başlangıcını bir açılış XML öğesi olarak yazar.

public:
 virtual void WriteStartObject(System::Xml::XmlWriter ^ writer, System::Object ^ graph);
public virtual void WriteStartObject(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 WriteStartObject(System.Xml.XmlWriter writer, object? graph);
public virtual void WriteStartObject(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 WriteStartObject(System.Xml.XmlWriter writer, object? graph);
abstract member WriteStartObject : System.Xml.XmlWriter * obj -> unit
override this.WriteStartObject : 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 WriteStartObject : System.Xml.XmlWriter * obj -> unit
override this.WriteStartObject : 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 WriteStartObject : System.Xml.XmlWriter * obj -> unit
override this.WriteStartObject : System.Xml.XmlWriter * obj -> unit
Public Overridable Sub WriteStartObject (writer As XmlWriter, graph As Object)

Parametreler

writer
XmlWriter

XmlWriter XML belgesini yazmak için kullanılan.

graph
Object

Serileştirecek nesne.

Öznitelikler

Özel durumlar

seri hale getirilen tür, veri sözleşmesi kurallarına uymuyor. Örneğin, DataContractAttribute özniteliği türüne uygulanmadı.

örneğin serileştirilmesiyle ilgili bir sorun var.

serileştirilen nesne sayısı üst sınırı aşıldı. MaxItemsInObjectGraph özelliğini denetleyin.

Şunlara uygulanır