/// <summary> /// 字典转换 /// </summary> /// <param name="dictionary">数据对象</param> private void dictionary <valueType, dictionaryValueType>(Dictionary <valueType, dictionaryValueType> dictionary) { if (dictionary == null) { CharStream.WriteJsonNull(); } else if (Push(dictionary)) { TypeSerializer <valueType> .Dictionary(this, dictionary); Pop(); } }
/// <summary> /// 字典转换 /// </summary> /// <param name="dictionary">字典</param> private void stringDictionary <valueType>(Dictionary <string, valueType> dictionary) { if (dictionary == null) { CharStream.WriteJsonNull(); } else if (Push(dictionary)) { if (Config.IsStringDictionaryToObject) { TypeSerializer <valueType> .StringDictionary(this, dictionary); } else { TypeSerializer <string> .Dictionary <valueType>(this, dictionary); } Pop(); } }