コード例 #1
0
ファイル: Location.cs プロジェクト: vnmcosta/fhir-net-api
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as PositionComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (LongitudeElement != null)
                    {
                        dest.LongitudeElement = (Hl7.Fhir.Model.FhirDecimal)LongitudeElement.DeepCopy();
                    }
                    if (LatitudeElement != null)
                    {
                        dest.LatitudeElement = (Hl7.Fhir.Model.FhirDecimal)LatitudeElement.DeepCopy();
                    }
                    if (AltitudeElement != null)
                    {
                        dest.AltitudeElement = (Hl7.Fhir.Model.FhirDecimal)AltitudeElement.DeepCopy();
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
コード例 #2
0
            public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (LongitudeElement != null)
                {
                    result.AddRange(LongitudeElement.Validate());
                }
                if (LatitudeElement != null)
                {
                    result.AddRange(LatitudeElement.Validate());
                }
                if (AltitudeElement != null)
                {
                    result.AddRange(AltitudeElement.Validate());
                }

                return(result);
            }