Пример #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");
            }
        }
Пример #2
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");
            }
        }