public Shape(Shape prototype) : base(prototype) { AllowMove = prototype.AllowMove; AllowScale = prototype.AllowScale; AllowRotate = prototype.AllowRotate; _drawSelected = prototype.DrawSelected; Direction = prototype.Direction; Interaction = prototype.Interaction; MaximumSize = prototype.MaximumSize; MinimumSize = prototype.MinimumSize; _keepAspect = prototype.KeepAspect; //Copy ports Ports = new Ports(Model); foreach (Port port in prototype.Ports.Values) { Port clone = (Port)port.Clone(); Ports.Add(port.Key, clone); clone.SuspendValidation(); clone.Location = port.Location; clone.ResumeValidation(); } }
public Link(Link prototype) { AllowMove = prototype.AllowMove; LineJoin = prototype.LineJoin; DrawSelected = prototype.DrawSelected; Interaction = prototype.Interaction; //Set up new origins Start = new Origin(prototype.FirstPoint); End = new Origin(prototype.LastPoint); Start.Marker = prototype.Start.Marker; End.Marker = prototype.End.Marker; List <PointF> points = new List <PointF>(); points.AddRange(prototype.Points); SetPoints(points); //Copy ports Ports = new Ports(Model); foreach (Port port in prototype.Ports.Values) { Port clone = (Port)port.Clone(); Ports.Add(port.Key, clone); clone.SuspendValidation(); clone.Location = port.Location; clone.ResumeValidation(); } if (prototype.Label != null) { Label = (Label)prototype.Label.Clone(); } if (prototype.Image != null) { Image = (Image)prototype.Image.Clone(); } DrawPath(); }