Пример #1
0
    public JSONListData Clone()
    {
        JSONListData clone = new JSONListData(new List <object>());

        foreach (object obj in _rawDataList)
        {
            object       val     = obj;
            JSONDictData valDict = val as JSONDictData;
            if (valDict != null)
            {
                val = valDict.Clone();
            }
            JSONListData valList = val as JSONListData;
            if (valList != null)
            {
                val = valList.Clone();
            }
            clone._rawDataList.Add(val);
        }
        return(clone);
    }
Пример #2
0
    public JSONDictData Clone()
    {
        JSONDictData clone = new JSONDictData(new Dictionary <string, object>());

        foreach (string key in _rawDataDict.Keys)
        {
            object       val     = _rawDataDict[key];
            JSONDictData valDict = val as JSONDictData;
            if (valDict != null)
            {
                val = valDict.Clone();
            }
            JSONListData valList = val as JSONListData;
            if (valList != null)
            {
                val = valList.Clone();
            }
            clone.SetValue(key, val);
        }
        return(clone);
    }