示例#1
0
        public virtual IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Element;

            if (dest != null)
            {
                if (Extension != null)
                {
                    dest.Extension = new List <Hl7.Fhir.Model.Extension>(Extension.DeepCopy());
                }
                if (ModifierExtension != null)
                {
                    dest.ModifierExtension = new List <Hl7.Fhir.Model.Extension>(ModifierExtension.DeepCopy());
                }
                if (Id != null)
                {
                    dest.Id = Id;
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DomainResource;

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

            base.CopyTo(dest);
            if (Text != null)
            {
                dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopy();
            }
            if (Contained != null)
            {
                dest.Contained = new List <Hl7.Fhir.Model.Resource>(Contained.DeepCopy());
            }
            if (Extension != null)
            {
                dest.Extension = new List <Hl7.Fhir.Model.Extension>(Extension.DeepCopy());
            }
            if (ModifierExtension != null)
            {
                dest.ModifierExtension = new List <Hl7.Fhir.Model.Extension>(ModifierExtension.DeepCopy());
            }
            return(dest);
        }
示例#3
0
        public virtual IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Resource;

            if (dest != null)
            {
                if (Extension != null)
                {
                    dest.Extension = new List <Hl7.Fhir.Model.Extension>(Extension.DeepCopy());
                }
                if (ModifierExtension != null)
                {
                    dest.ModifierExtension = new List <Hl7.Fhir.Model.Extension>(ModifierExtension.DeepCopy());
                }
                if (LanguageElement != null)
                {
                    dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy();
                }
                if (Text != null)
                {
                    dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopy();
                }
                if (Contained != null)
                {
                    dest.Contained = new List <Hl7.Fhir.Model.Resource>(Contained.DeepCopy());
                }
                if (Id != null)
                {
                    dest.Id = Id;
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }