示例#1
0
 public override void Add (string aKey, JsonNode aItem)
 {
     var tmp = new JsonClass();
     tmp.Add(aKey, aItem);
     Set(tmp);
 }
示例#2
0
 private void Set(JsonNode aVal)
 {
     if (m_Key == null)
     {
         m_Node.Add(aVal);
     }
     else
     {
         m_Node.Add(m_Key, aVal);
     }
     m_Node = null; // Be GC friendly.
 }
示例#3
0
 public override void Add (JsonNode aItem)
 {
     var tmp = new JsonArray();
     tmp.Add(aItem);
     Set(tmp);
 }
示例#4
0
 public JsonLazyCreator(JsonNode aNode)
 {
     m_Node = aNode;
     m_Key  = null;
 }
示例#5
0
 public JsonLazyCreator(JsonNode aNode, string aKey)
 {
     m_Node = aNode;
     m_Key = aKey;
 }
示例#6
0
 public override JsonNode Remove(JsonNode aNode)
 {
     try
     {
         var item = m_Dict.Where(k => k.Value == aNode).First();
         m_Dict.Remove(item.Key);
         return aNode;
     }
     catch
     {
         return null;
     }
 }
示例#7
0
 public virtual JsonNode Remove(JsonNode aNode) { return aNode; }
示例#8
0
 public virtual void Add(JsonNode aItem)
 {
     Add("", aItem);
 }
示例#9
0
 public override void Add(string aKey, JsonNode aItem)
 {
     if (!string.IsNullOrEmpty(aKey))
     {
         if (m_Dict.ContainsKey(aKey))
             m_Dict[aKey] = aItem;
         else
             m_Dict.Add(aKey, aItem);
     }
     else
         m_Dict.Add(Guid.NewGuid().ToString(), aItem);
 }
示例#10
0
 public virtual void Add(string aKey, JsonNode aItem){ }
示例#11
0
 public override JsonNode Remove(JsonNode aNode)
 {
     m_List.Remove(aNode);
     return aNode;
 }
示例#12
0
 public override void Add(string aKey, JsonNode aItem)
 {
     m_List.Add(aItem);
 }