public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as DocumentReferenceServiceComponent; if (dest != null) { base.CopyTo(dest); if (Type != null) { dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); } if (AddressElement != null) { dest.AddressElement = (Hl7.Fhir.Model.FhirString)AddressElement.DeepCopy(); } if (Parameter != null) { dest.Parameter = new List <Hl7.Fhir.Model.DocumentReference.DocumentReferenceServiceParameterComponent>(Parameter.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
internal Response(ReturnCode result, string postcode, int? addressId, AddressType? addressType, MatchLevel matchLevel, string[] postalAddress, AddressElement[] postalAddressElements, string[] geographicAddress, AddressElement[] geographicAddressElements, string[] vanityAddress, AddressElement[] vanityAddressElements, ReformattedAddressResult? reformattedAddressResult, string[] reformattedAddress, int totalOptions, Option[] options, Request input, Model.Link[] links ) { if (links == null) throw new ArgumentNullException("links"); Result = result; Postcode = postcode; AddressId = addressId; AddressType = addressType; MatchLevel = matchLevel; PostalAddress = postalAddress; PostalAddressElements = postalAddressElements; GeographicAddress = geographicAddress; GeographicAddressElements = geographicAddressElements; VanityAddress = vanityAddress; VanityAddressElements = vanityAddressElements; ReformattedAddressResult = reformattedAddressResult; ReformattedAddress = reformattedAddress; TotalOptions = totalOptions; Options = options; Input = input; var newLinks = new List<Model.Link>(); foreach (Model.Link link in links) { Model.Link newLink; switch (link.Rel) { case "self": newLink = new Model.PostcodeLookup.Link(link.Rel, link.Href); break; default: newLink = link; break; } newLinks.Add(newLink); } Links = newLinks.ToArray(); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Endpoint; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.Endpoint.EndpointStatus>)StatusElement.DeepCopy(); } if (ConnectionType != null) { dest.ConnectionType = (Hl7.Fhir.Model.Coding)ConnectionType.DeepCopy(); } if (NameElement != null) { dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); } if (ManagingOrganization != null) { dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); } if (Contact != null) { dest.Contact = new List <Hl7.Fhir.Model.ContactPoint>(Contact.DeepCopy()); } if (Period != null) { dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); } if (PayloadType != null) { dest.PayloadType = new List <Hl7.Fhir.Model.CodeableConcept>(PayloadType.DeepCopy()); } if (PayloadMimeTypeElement != null) { dest.PayloadMimeTypeElement = new List <Hl7.Fhir.Model.Code>(PayloadMimeTypeElement.DeepCopy()); } if (AddressElement != null) { dest.AddressElement = (Hl7.Fhir.Model.FhirUrl)AddressElement.DeepCopy(); } if (HeaderElement != null) { dest.HeaderElement = new List <Hl7.Fhir.Model.FhirString>(HeaderElement.DeepCopy()); } return(dest); }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (Type != null) { result.AddRange(Type.Validate()); } if (AddressElement != null) { result.AddRange(AddressElement.Validate()); } if (Parameter != null) { Parameter.ForEach(elem => result.AddRange(elem.Validate())); } return(result); }
public IFormElement Render() { IFormElement element; switch (Type) { case FormElementType.Entry: element = new EntryElement(); break; case FormElementType.Address: element = new AddressElement(); break; case FormElementType.DatePicker: element = new DatePickerElement(); break; case FormElementType.Picker: element = new PickerElement(); break; case FormElementType.Editor: element = new EditorElement(); break; case FormElementType.Switch: element = new SwitchElement(); break; case FormElementType.CheckboxList: element = new CheckboxListElement(); break; case FormElementType.Hidden: element = new HiddenElement(); break; case FormElementType.Button: element = new ButtonElement(); break; case FormElementType.Label: element = new LabelElement(); break; default: element = new EntryElement(); break; } element.Label = this.Label; element.Key = Key; element.Keyboard = Keyboard; element.HeightRequest = HeightRequest; element.Options = Options; element.Required = Required; element.Attributes = Attributes; element.AutoPostBack = AutoPostBack; if (!string.IsNullOrWhiteSpace(ElementBackgroundColor)) { element.ElementBackgroundColor = (Color) new ColorTypeConverter().ConvertFromInvariantString(ElementBackgroundColor); } if (!string.IsNullOrWhiteSpace(ElementTextColor)) { element.ElementTextColor = (Color) new ColorTypeConverter().ConvertFromInvariantString(ElementTextColor); } element.Render(); if (!string.IsNullOrWhiteSpace(Value)) { element.Value = Value; } return(element); }