语言

DataContractJsonSerializer.IsStartObject 方法

定义

获取一个值,该值指定序列化程序是否可以读取对象。

重载

名称 说明
IsStartObject(XmlDictionaryReader)

获取一个值,该值指定是否 XmlDictionaryReader 定位在表示序列化程序可从中反序列化的对象的 XML 元素上。

IsStartObject(XmlReader)

确定该对象是否 XmlReader 位于可反序列化的对象上。

IsStartObject(XmlDictionaryReader)

Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs

获取一个值,该值指定是否 XmlDictionaryReader 定位在表示序列化程序可从中反序列化的对象的 XML 元素上。

public:
 override bool IsStartObject(System::Xml::XmlDictionaryReader ^ reader);
[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 override bool IsStartObject(System.Xml.XmlDictionaryReader reader);
public override bool IsStartObject(System.Xml.XmlDictionaryReader reader);
[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 override bool IsStartObject(System.Xml.XmlDictionaryReader reader);
[<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.")>]
override this.IsStartObject : System.Xml.XmlDictionaryReader -> bool
override this.IsStartObject : System.Xml.XmlDictionaryReader -> bool
[<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.")>]
override this.IsStartObject : System.Xml.XmlDictionaryReader -> bool
Public Overrides Function IsStartObject (reader As XmlDictionaryReader) As Boolean

参数

reader
XmlDictionaryReader

XmlDictionaryReader用于读取从 JSON 映射的 XML 流。

返回

true 如果正确定位了读取器,则为否则,为 false.

属性

注解

它 IsStartObject 通过检查它是否位于 XML 元素上来确定它是否可以读取对象。 它还检查读取器定位在的 XML 元素的名称和命名空间,并将值与预期的名称和命名空间进行比较。 可以使用传入构造函数的值(如果存在)设置 rootName 预期名称;如果不存在,则为“root”。 预期的命名空间是空字符串。

请注意,此方法适用于使用从 JSON 映射的 XML 时的高级方案。

适用于

IsStartObject(XmlReader)

Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs

确定该对象是否 XmlReader 位于可反序列化的对象上。

public:
 override bool IsStartObject(System::Xml::XmlReader ^ reader);
[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 override bool IsStartObject(System.Xml.XmlReader reader);
public override bool IsStartObject(System.Xml.XmlReader reader);
[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 override bool IsStartObject(System.Xml.XmlReader reader);
[<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.")>]
override this.IsStartObject : System.Xml.XmlReader -> bool
override this.IsStartObject : System.Xml.XmlReader -> bool
[<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.")>]
override this.IsStartObject : System.Xml.XmlReader -> bool
Public Overrides Function IsStartObject (reader As XmlReader) As Boolean

参数

reader
XmlReader

XmlReader用于读取 XML 流。

返回

true 如果正确定位了读取器,则为否则,为 false.

属性

注解

此方法检查读取器是否位于可反序列化的元素上,并返回 true 是否为该元素。 若要返回 true,找到的元素必须具有预期的名称。

适用于