예제 #1
0
            private XsdNs.AbstractSimpleComponentType GetValueProxy()
            {
                XsdNs.AbstractSimpleComponentType retval = null;

                if (DataType.Equals(typeof(string)))
                {
                    retval = new XsdNs.TextType();
                }
                else if (DataType.Equals(typeof(bool)))
                {
                    retval = new XsdNs.BooleanType();
                }
                else if (DataType.Equals(typeof(long)))
                {
                    retval = new XsdNs.CountType();
                }
                else if (DataType.Equals(typeof(double)))
                {
                    retval = new XsdNs.QuantityType()
                    {
                        uom = new XsdNs.UnitReference()
                        {
                            code = UnitOfMeasure
                        }
                    };
                }
                else if (DataType.Equals(typeof(DateTime)))
                {
                    retval = new XsdNs.TimeType1()
                    {
                        // The XML schema requires this "uom" element here
                        uom = new XsdNs.UnitReference()
                    };
                }
                else
                {
                    throw new ArgumentException("Unexpected column type " + DataType.ToString());
                }

                // Assign descrition and label
                retval.label       = Label;
                retval.description = Description;
                return(retval);
            }
예제 #2
0
 /// <summary>
 /// Constructor. Use this to instantiate an item from XML (data record field).
 /// </summary>
 /// <param name="el">XML data.</param>
 /// <exception cref="XNeut.InvalidMessageException">Thrown if an error is encountered.</exception>
 internal Item_Count(XsdNs.CountType el) : this(el.value)
 {
     // Empty ctor body
 }