C# Class SysInfo.NameValue

JSON returns Name-Value pairs When show results of queries, create a NameValue obkect for each JSON name-value object The List binds to the Name and Vlaue property of NameValue object list (NameValue.NameValues).
显示文件 Open project: djaus2/IoTSysInfo Class Usage Examples

Public Properties

Property Type Description
NameValues List
NameValuesStack Stack>

Public Methods

Method Description
ClearList ( ) : void
GetNameValues ( string preName, JsonObject oJson ) : void

This is the "Powerhouse" Get all name-value pairs in the object - For each value get its value if simple type - If value is an array get objects in array an recursively call this for each item in the array - If value is an object call this recursiveky.

NameValue ( JsonObject oJsn ) : System

Create obvject from JSON obkect

NameValue ( string preName, int index, IJsonValue>.KeyValuePair oJson_KVP ) : System

Create object from JSON KeyValuePair This is what is used below

NameValue ( string name, string value ) : System

Standard constructor

Method Details

ClearList() public static method

public static ClearList ( ) : void
return void

GetNameValues() public static method

This is the "Powerhouse" Get all name-value pairs in the object - For each value get its value if simple type - If value is an array get objects in array an recursively call this for each item in the array - If value is an object call this recursiveky.
public static GetNameValues ( string preName, JsonObject oJson ) : void
preName string Text to prepend to name in list
oJson JsonObject The JSON object
return void

NameValue() public method

Create obvject from JSON obkect
public NameValue ( JsonObject oJsn ) : System
oJsn JsonObject The JSON obkect
return System

NameValue() public method

Create object from JSON KeyValuePair This is what is used below
public NameValue ( string preName, int index, IJsonValue>.KeyValuePair oJson_KVP ) : System
preName string Higher level info about this branch
index int If an array item apply index to prepend of name
oJson_KVP IJsonValue>.KeyValuePair
return System

NameValue() public method

Standard constructor
public NameValue ( string name, string value ) : System
name string JSON name of properfty
value string JSON value of property
return System

Property Details

NameValues public_oe static_oe property

This is the list that is bound to the listbox
public static List NameValues
return List

NameValuesStack public_oe static_oe property

public static Stack> NameValuesStack
return Stack>