private void AddValue() { if (m_plist == null) { m_result = "Please load the plist before calling its API's"; return; } if (string.IsNullOrEmpty(m_input)) { m_result = "Failed to add value"; return; } object _JSONObject = JSONUtility.FromJSON(m_input); if (_JSONObject != null) { m_plist.AddValue(m_keyPath, _JSONObject); m_result = "Plist=" + JSONUtility.ToJSON(m_plist); } else { m_plist.AddValue(m_keyPath, m_input); m_result = "Plist=" + JSONUtility.ToJSON(m_plist); } }
private void URLRequestFinished(object _responseData, string _error) { AddNewResult(string.Format("Twitter request finished. Error= {0}.", _error.GetPrintableString())); if (_error == null) { AppendResult("Response data = " + JSONUtility.ToJSON(_responseData) + "."); } AppendResult("Also, don't forget to check PostURLRequest, PutURLRequest, DeleteURLRequest"); }
private void LoadPlistText() { if (string.IsNullOrEmpty(m_input)) { m_result = "Failed to load plist"; return; } // Load plist m_plist = Plist.Load(m_input); // Result m_result = "Plist=" + JSONUtility.ToJSON(m_plist); }
private static void ExtractAndSerializeXcodeModInfo(Dictionary <string, object> modifierCollectionDict, string key, string relativePath) { object _modifierData; if (modifierCollectionDict.TryGetValue(key, out _modifierData)) { string _modifierFileName = key + ".xcodemods"; File.WriteAllText(Path.Combine(relativePath, _modifierFileName), JSONUtility.ToJSON(_modifierData)); return; } DebugUtility.Logger.Log("Couldn't create modifier file for key: " + key); }
private void OnGUIButtonPressed(string _buttonName) { int _errorIndex = 0; object _value = JSONUtility.FromJSON(m_JSONObject, ref _errorIndex); if (_errorIndex == -1) { m_result = "Value=" + JSONUtility.ToJSON(_value) + "\nType=" + _value.GetType(); } else { m_result = "Something went wrong!!! Value=NULL. " + "\nError index =" + _errorIndex + "" + "\nSubstring =" + m_JSONObject.Substring(_errorIndex); } }
private List <string> GetChangedKeys(IDictionary _localData, IDictionary _cloudData) { List <string> _changedKeys = new List <string>(); // Merging and getting the total keys to reflect any removed keys. List <string> _totalKeys = MergeList(_localData.Keys, _cloudData.Keys); foreach (string _eachKey in _totalKeys) { object _eachCloudValue = _cloudData.GetIfAvailable <object>(_eachKey); object _eachLocalValue = _localData.GetIfAvailable <object>(_eachKey); // If the values don't match, we can tell the keys got changed. if (!JSONUtility.ToJSON(_eachLocalValue).Equals(JSONUtility.ToJSON(_eachCloudValue))) { _changedKeys.Add(_eachKey); } } return(_changedKeys); }