protected void PushDataStructure(Object obj, JSONObjectType type) { _currentDataStructure = new JSONObject(obj, type); if (_inValue) { _currentDataStructure.Name = _dataStructureName; } _dataStructureStack.Push(_currentDataStructure); }
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); } }
protected JSONObject PopDataStructure() { _currentDataStructure = (JSONObject)_dataStructureStack.Pop(); return _currentDataStructure; }