public virtual ConnectionInfo Clone() { var newConnectionInfo = new ConnectionInfo(); newConnectionInfo.CopyFrom(this); newConnectionInfo.ConstantID = MiscTools.CreateConstantID(); newConnectionInfo.Inheritance = Inheritance.Clone(); return(newConnectionInfo); }
public virtual ConnectionInfo Clone() { var newConnectionInfo = new ConnectionInfo(); newConnectionInfo.CopyFrom(this); newConnectionInfo.Inheritance = Inheritance.Clone(); newConnectionInfo.Inheritance.Parent = newConnectionInfo; return(newConnectionInfo); }
// Deep clone, recursive public override ConnectionInfo Clone() { var newContainer = new ContainerInfo(); newContainer.CopyFrom(this); newContainer.OpenConnections = new ProtocolList(); newContainer.Inheritance = Inheritance.Clone(); foreach (var child in Children.ToArray()) { var newChild = child.Clone(); newChild.RemoveParent(); newContainer.AddChild(newChild); } return(newContainer); }