Пример #1
0
 public object GetObjectClone(string key, object defaultVal = null)
 {
     if (data.objects.ContainsKey(key))
     {
         object result = data.objects[key];
         return(result != null?SerializationHelper.CloneDeep(result) : null);
     }
     else
     {
         return(defaultVal);
     }
 }
Пример #2
0
    public void SetObjectClone(string key, object value)
    {
        object clone = value != null?SerializationHelper.CloneDeep(value) : null;

        if (data.objects.ContainsKey(key))
        {
            data.objects[key] = clone;
        }
        else
        {
            data.objects.Add(key, clone);
        }
    }