/// <summary> /// Copy the value of another IJSONValue into our underlying value. /// </summary> /// <param name="value"></param> /// <returns></returns> public override void CopyValue(IJSONValue value) { if (!GetType().IsAssignableFrom(value.GetType())) { throw new Exception("Can't assign a " + value.GetType().Name + " to a " + GetType().Name); } }
/// <summary> /// Copy the value of another IJSONValue into our underlying value. /// </summary> /// <param name="value"></param> /// <returns></returns> public override void CopyValue(IJSONValue value) { if (!GetType().IsAssignableFrom(value.GetType())) { throw new Exception("Can't assign a " + value.GetType().Name + " to a " + GetType().Name); } IList <IJSONValue> source = (IList <IJSONValue>)value.Value; mValue = new List <IJSONValue>(); foreach (IJSONValue json in source) { mValue.Add(json.DeepCopy()); } }