C# 클래스 Netduino.WebServer.Core.Json.PropertyTable

Contains a snapshot of all of the classes currently loaded by the Assembly and enumerates their class names, properties and property types into a Hashtable. The table is then referenced against a decoded Json string to determine what data types a given chunk of Json string represents. When a match is found, that class is instantiated and its properties populated with the Json data.
파일 보기 프로젝트 열기: martinbuberl/Netduino 1 사용 예제들

공개 메소드들

메소드 설명
DumpObjects ( Hashtable hash, int level ) : void

Debugging/Diagnostic tool that dumps objects and their children.

FindObject ( Hashtable jsonTable ) : object

Searches the Hashtable for an object that contains a property name specified by key. The key may be composed of colon-delimited object names representing a class heirarchy.

PropertyTable ( ) : System
Snapshot ( ) : void

Takes a snapshot of the classes and their property names and types

비공개 메소드들

메소드 설명
DumpObjectArray ( ArrayList array, int level ) : void
FindMatchingDictionary ( Hashtable jsonTable ) : DictionaryEntry

Searches the ArrayList of Hashtables generated at startup time, and returns the Hashtable that matches the specified Hashtable.

GetProperties ( Type types ) : Hashtable

High-level method that enumerates all Types in the loaded assembly, and places their class names and properties in a hashtable. At deserialization time, this Hashtable (containing Property Names and Types) is compared to the Hashtable containing the JSON Property Names and Values, and the result of the two Hashtables is the desired instantiated object.

GetProperty ( Type type ) : Hashtable
GetValueFromJsonHashtable ( Hashtable jsonTable, string name ) : object

Returns the Value that matches the specified name. The Value can be anything: a value type (integer, string, etc), or another class, or a Hasthtable, DictionaryEntry, or ArrayList.

SetProperty ( object parent, Type parentType, Hashtable classDefinition, DictionaryEntry entry, Hashtable jsonTable ) : void

Sets a single Property on an object. That single Property can be a Value Type, and ArrayList, Hashtable, essentially anything that's legal to deserialize. This method will recurse into itself to set all of this Property's values, children objects and values, etc.

SetTypedValue ( object parent, Type parentType, string name, string type, object unTypedValue ) : void

Performs the type conversion that is normally standard stuff for .NET, but missing in .NET MF. Basically, the unTypedValue object cannot be converted or cast using boxing or a simple cast, except for the actual Type defined inside the object (the object's Parse method ReturnType). So this function discovers what the unTypedValue's inner Type really is, compares that with the destination Property's real Type, and performs a cast specific to those two types.

메소드 상세

DumpObjects() 공개 정적인 메소드

Debugging/Diagnostic tool that dumps objects and their children.
public static DumpObjects ( Hashtable hash, int level ) : void
hash System.Collections.Hashtable
level int
리턴 void

FindObject() 공개 메소드

Searches the Hashtable for an object that contains a property name specified by key. The key may be composed of colon-delimited object names representing a class heirarchy.
public FindObject ( Hashtable jsonTable ) : object
jsonTable System.Collections.Hashtable
리턴 object

PropertyTable() 공개 메소드

public PropertyTable ( ) : System
리턴 System

Snapshot() 공개 메소드

Takes a snapshot of the classes and their property names and types
public Snapshot ( ) : void
리턴 void