Exemple #1
0
        public new static CodeValue Create(XElement xCodeValue)
        {
            foreach (var xSubtype in xCodeValue.Elements())
            {
                if (xSubtype.Name == CodeValueNumeric.ElementName)
                {
                    return(CodeValueNumeric.Create(xSubtype));
                }
                if (xSubtype.Name == CodeValueBoolean.ElementName)
                {
                    return(CodeValueBoolean.Create(xSubtype));
                }
                if (xSubtype.Name == CodeValueDateTime.ElementName)
                {
                    return(CodeValueDateTime.Create(xSubtype));
                }
                if (xSubtype.Name == CodeValueException.ElementName)
                {
                    return(CodeValueException.Create(xSubtype));
                }
                if (xSubtype.Name == CodeValueString.ElementName)
                {
                    return(CodeValueString.Create(xSubtype));
                }
                if (xSubtype.Name == CodeValueType.ElementName)
                {
                    return(CodeValueType.Create(xSubtype));
                }
                if (xSubtype.Name == CodeValueObject.ElementName)
                {
                    return(CodeValueObject.Create(xSubtype));
                }

                throw new InvalidOperationException(string.Format("Unknown subtype element {0}", xSubtype.Name));
            }

            throw new InvalidOperationException("No subtype element specified.");
        }
 public override bool Equals(CodeValueNumeric other)
 {
     return(Equals(other as CodeValueDouble));
 }