Beispiel #1
0
 protected void PushDataStructure(Object obj, JSONObjectType type)
 {
     _currentDataStructure = new JSONObject(obj, type);
     if (_inValue) {
         _currentDataStructure.Name = _dataStructureName;
     }
     _dataStructureStack.Push(_currentDataStructure);
 }
Beispiel #2
0
 protected void StoreCurrentDataStructure()
 {
     var innerStructure = (JSONObject)_dataStructureStack.Pop();
     _currentDataStructure = (JSONObject)_dataStructureStack.Peek();
     if (_currentDataStructure.ObjectType == JSONObjectType.Object) {
         var name = (string)_dataStack.Pop();
         Debug.Print("STR: Popped data: " + name);
         var hashTable = (Hashtable)_currentDataStructure.Object;
         hashTable.Add(name, innerStructure);
     } else {
         var arrayList = (ArrayList)_currentDataStructure.Object;
         arrayList.Add(innerStructure);
     }
 }
Beispiel #3
0
 protected JSONObject PopDataStructure()
 {
     _currentDataStructure = (JSONObject)_dataStructureStack.Pop();
     return _currentDataStructure;
 }