public SafetyCheckFault Clone() { //simple memberwise clone deal with all value types SafetyCheckFault clone = this.MemberwiseClone() as SafetyCheckFault; // deep copy of images clone.Images = new List <Image>(); foreach (Image image in this.Images) { clone.Images.Add(image); } return(clone); }
//Sets the safety check fault with member values from another safety check fault public void ValuesFrom(SafetyCheckFault sourceFault) { this.ID = sourceFault.ID; this.FaultTypeID = sourceFault.FaultTypeID; this.Comment = sourceFault.Comment; this.IsDiscretionaryPass = sourceFault.IsDiscretionaryPass; this.FaultTypeReference = sourceFault.FaultTypeReference; this.SafetyCheckDataID = sourceFault.SafetyCheckDataID; this.Images.Clear(); foreach (Image image in sourceFault.Images) { this.Images.Add(image); } }