C# Class HelloWorld.ItemListJsonConverter

Inheritance: Newtonsoft.Json.JsonConverter
ファイルを表示 Open project: Ivony/HelloWorld Class Usage Examples

Public Methods

Method Description
CanConvert ( Type objectType ) : bool
FromJson ( Newtonsoft.Json.Linq.JObject data ) : Item[]

从 JSON 数据中加载

ReadJson ( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) : object
ToJson ( IEnumerable list ) : Newtonsoft.Json.Linq.JObject

转换为 JSON 数据对象

WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void

Private Methods

Method Description
CreateItem ( JProperty property ) : Item

Method Details

CanConvert() public method

public CanConvert ( Type objectType ) : bool
objectType System.Type
return bool

FromJson() public static method

从 JSON 数据中加载
public static FromJson ( Newtonsoft.Json.Linq.JObject data ) : Item[]
data Newtonsoft.Json.Linq.JObject JSON 数据
return Item[]

ReadJson() public method

public ReadJson ( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) : object
reader Newtonsoft.Json.JsonReader
objectType System.Type
existingValue object
serializer Newtonsoft.Json.JsonSerializer
return object

ToJson() public static method

转换为 JSON 数据对象
public static ToJson ( IEnumerable list ) : Newtonsoft.Json.Linq.JObject
list IEnumerable 数据源
return Newtonsoft.Json.Linq.JObject

WriteJson() public method

public WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void
writer Newtonsoft.Json.JsonWriter
value object
serializer Newtonsoft.Json.JsonSerializer
return void