internal void Copy(VMObject other) { if (other == null || other.Type == VMType.None) { this.Type = VMType.None; this.Data = null; return; } this.Type = other.Type; if (other.Type == VMType.Struct) { var children = new Dictionary <VMObject, VMObject>(); var otherChildren = other.GetChildren(); foreach (var key in otherChildren.Keys) { var temp = new VMObject(); temp.Copy(otherChildren[key]); children[key] = temp; } this.Data = children; } else { this.Data = other.Data; /*var temp = other.Data; * _data = new byte[temp.Length]; * Array.Copy(temp, _data, _data.Length);*/ } }