JsonObject 类

定义

public ref class JsonObject : System::Json::JsonValue, System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::String ^, System::Json::JsonValue ^>>, System::Collections::Generic::IDictionary<System::String ^, System::Json::JsonValue ^>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Json::JsonValue ^>>
public class JsonObject : System.Json.JsonValue, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,System.Json.JsonValue>>, System.Collections.Generic.IDictionary<string,System.Json.JsonValue>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,System.Json.JsonValue>>
type JsonObject = class
    inherit JsonValue
    interface IDictionary<string, JsonValue>
    interface ICollection<KeyValuePair<string, JsonValue>>
    interface seq<KeyValuePair<string, JsonValue>>
    interface IEnumerable
Public Class JsonObject
Inherits JsonValue
Implements ICollection(Of KeyValuePair(Of String, JsonValue)), IDictionary(Of String, JsonValue), IEnumerable(Of KeyValuePair(Of String, JsonValue))
继承
JsonObject
实现

注解

注意

命名空间 System.Json 是为不再受支持的 Silverlight 设计的。 若要处理 JSON,建议改用 命名空间中的 System.Text.Json API。

构造函数

JsonObject(IEnumerable<KeyValuePair<String,JsonValue>>)
JsonObject(KeyValuePair<String,JsonValue>[])

属性

Count

获取 ICollection<T> 中包含的元素数。

Item[Int32] (继承自 JsonValue)
Item[String]

获取或设置具有指定键的元素。

JsonType
Keys

获取包含 ICollection<T> 的键的 IDictionary<TKey,TValue>

Values

获取一个 ICollection<T>,它包含 IDictionary<TKey,TValue> 中的值。

方法

Add(KeyValuePair<String,JsonValue>)

将某项添加到 ICollection<T> 中。

Add(String, JsonValue)

IDictionary<TKey,TValue> 添加一个带有所提供的键和值的元素。

AddRange(IEnumerable<KeyValuePair<String,JsonValue>>)
AddRange(KeyValuePair<String,JsonValue>[])
Clear()

ICollection<T> 中移除所有项。

ContainsKey(String)

确定是否 IDictionary<TKey,TValue> 包含带有指定键的元素。

CopyTo(KeyValuePair<String,JsonValue>[], Int32)

从特定的 ICollection<T> 索引开始,将 Array 的元素复制到一个 Array 中。

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetEnumerator()

返回一个循环访问集合的枚举器。

GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
Remove(String)

IDictionary<TKey,TValue> 中移除包含指定键的元素。

Save(Stream)
Save(TextWriter) (继承自 JsonValue)
ToString() (继承自 JsonValue)
TryGetValue(String, JsonValue)

显式接口实现

ICollection<KeyValuePair<String,JsonValue>>.Contains(KeyValuePair<String,JsonValue>)

确定 ICollection<T> 是否包含特定值。

ICollection<KeyValuePair<String,JsonValue>>.IsReadOnly

获取一个值,该值指示 ICollection<T> 是否为只读。

ICollection<KeyValuePair<String,JsonValue>>.Remove(KeyValuePair<String,JsonValue>)

ICollection<T> 中移除特定对象的第一个匹配项。

IEnumerable.GetEnumerator()

返回循环访问集合的枚举数。

扩展方法

AsReadOnly<TKey,TValue>(IDictionary<TKey,TValue>)

返回当前字典的只读 ReadOnlyDictionary<TKey,TValue> 包装器。

CopyToDataTable<T>(IEnumerable<T>)

在给定其泛型参数 TDataTable 的输入 DataRow 对象的情况下,返回包含 IEnumerable<T> 对象副本的 DataRow

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRow

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRow

适用于