コード例 #1
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as ProdCharacteristic;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (Height != null)
            {
                dest.Height = (Hl7.Fhir.Model.Quantity)Height.DeepCopy();
            }
            if (Width != null)
            {
                dest.Width = (Hl7.Fhir.Model.Quantity)Width.DeepCopy();
            }
            if (Depth != null)
            {
                dest.Depth = (Hl7.Fhir.Model.Quantity)Depth.DeepCopy();
            }
            if (Weight != null)
            {
                dest.Weight = (Hl7.Fhir.Model.Quantity)Weight.DeepCopy();
            }
            if (NominalVolume != null)
            {
                dest.NominalVolume = (Hl7.Fhir.Model.Quantity)NominalVolume.DeepCopy();
            }
            if (ExternalDiameter != null)
            {
                dest.ExternalDiameter = (Hl7.Fhir.Model.Quantity)ExternalDiameter.DeepCopy();
            }
            if (ShapeElement != null)
            {
                dest.ShapeElement = (Hl7.Fhir.Model.FhirString)ShapeElement.DeepCopy();
            }
            if (ColorElement != null)
            {
                dest.ColorElement = new List <Hl7.Fhir.Model.FhirString>(ColorElement.DeepCopy());
            }
            if (ImprintElement != null)
            {
                dest.ImprintElement = new List <Hl7.Fhir.Model.FhirString>(ImprintElement.DeepCopy());
            }
            if (Image != null)
            {
                dest.Image = new List <Hl7.Fhir.Model.Attachment>(Image.DeepCopy());
            }
            if (Scoring != null)
            {
                dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopy();
            }
            return(dest);
        }