Example #1
0
 public override IDeepCopyable CopyTo(IDeepCopyable other)
 {
     var dest = other as Identifier;
     
     if (dest != null)
     {
         base.CopyTo(dest);
         if(UseElement != null) dest.UseElement = (Code<Hl7.Fhir.Model.Identifier.IdentifierUse>)UseElement.DeepCopy();
         if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
         if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy();
         if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy();
         if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
         if(Assigner != null) dest.Assigner = (Hl7.Fhir.Model.ResourceReference)Assigner.DeepCopy();
         return dest;
     }
     else
     	throw new ArgumentException("Can only copy to an object of the same type", "other");
 }
Example #2
0
        public override string DataToValue(ValueElement element, dynamic data)
        {
            var resolvedDef = ResolveDef(element.container);

            return(resolvedDef.DataToValue(element, data));
        }
Example #3
0
 public virtual void SetData(ValueElement element, dynamic data)
 {
     element._data = data;
     element.SetState(ElementState.Modified);
 }
Example #4
0
 public virtual void SetValue(ValueElement element, string value)
 {
     SetData(element, formatDef == null
         ? DataHelpers.ParseInt64(value)
         : formatDef.ValueToData(element, value));
 }
Example #5
0
 public override dynamic ValueToData(ValueElement element, string value)
 {
     return(Int64.Parse(value));
 }
Example #6
0
 internal virtual void WriteData(
     ValueElement element, PluginFileOutput output
     )
 {
     throw new NotImplementedException();
 }
Example #7
0
 public override string DataToValue(ValueElement element, dynamic data)
 {
     return(data.ToString());
 }
Example #8
0
 private MainRecord ResolveNavmesh(ValueElement element)
 {
     return(element?.container?.elements?[0].referencedRecord);
 }
Example #9
0
        public override dynamic ValueToData(ValueElement element, string value)
        {
            float v = float.Parse(value);

            return(Math.Min(Math.Round(v * 1270 + 127), 254));
        }
Example #10
0
        public override string DataToValue(ValueElement element, dynamic data)
        {
            float v = (data - 127) / 1270.0f;

            return(v.ToString("F4"));
        }
        // Required for the parsing to work
#pragma warning disable IDE0051 // Remove unused private members
        private void AddValueElement(ValueElement value)
        {
            this.ValueElements.Add(value);
        }