예제 #1
0
        public virtual ConnectionInfo Clone()
        {
            var newConnectionInfo = new ConnectionInfo();

            newConnectionInfo.CopyFrom(this);
            newConnectionInfo.ConstantID  = MiscTools.CreateConstantID();
            newConnectionInfo.Inheritance = Inheritance.Clone();
            return(newConnectionInfo);
        }
예제 #2
0
        public virtual ConnectionInfo Clone()
        {
            var newConnectionInfo = new ConnectionInfo();

            newConnectionInfo.CopyFrom(this);
            newConnectionInfo.Inheritance        = Inheritance.Clone();
            newConnectionInfo.Inheritance.Parent = newConnectionInfo;
            return(newConnectionInfo);
        }
예제 #3
0
        // 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);
        }