public void SetDecimal () {
if (this.dstruct != null) {
return;
}
// Debug.Assert(!this.IsDecimal);
switch(xsdtype.TypeCode) {
case XmlTypeCode.Byte:
case XmlTypeCode.UnsignedByte:
case XmlTypeCode.Short:
case XmlTypeCode.UnsignedShort:
case XmlTypeCode.Int:
case XmlTypeCode.UnsignedInt:
case XmlTypeCode.Long:
case XmlTypeCode.UnsignedLong:
case XmlTypeCode.Decimal:
case XmlTypeCode.Integer:
case XmlTypeCode.PositiveInteger:
case XmlTypeCode.NonNegativeInteger:
case XmlTypeCode.NegativeInteger:
case XmlTypeCode.NonPositiveInteger:
if (this.isList) {
this.dstruct = new DecimalStruct(this.dim);
for (int i = 0; i < this.dim; i ++) {
this.dstruct.Dvalue[i] = Convert.ToDecimal (((Array) this.ovalue).GetValue(i),NumberFormatInfo.InvariantInfo);
}
}
else { //not list
this.dstruct = new DecimalStruct();
//possibility of list of length 1.
this.dstruct.Dvalue[0] = Convert.ToDecimal (this.ovalue, NumberFormatInfo.InvariantInfo);
}
this.dstruct.IsDecimal = true;
break;
default:
if (this.isList) {
this.dstruct = new DecimalStruct(this.dim);
}
else {
this.dstruct = new DecimalStruct();
}
break;
}
}