public object DeepCopy() { var other = RedTypeManager.Create(GetType()); foreach (var property in _properties) { if (property.Value is IRedCloneable cl) { other._properties[property.Key] = (IRedType)cl.DeepCopy(); } else { other._properties[property.Key] = property.Value; } } return(other); }
public object DeepCopy() { var other = (IList <T>)RedTypeManager.CreateRedType(GetType()); foreach (var element in _internalList) { if (element is IRedCloneable cl) { other.Add((T)cl.DeepCopy()); } else { other.Add(element); } } return(other); }