public override Field Convert(GroupValue fieldDef, ITemplateRegistry templateRegistry, ConversionContext context) { var name = new QName(fieldDef.GetString("Name"), fieldDef.GetString("Ns")); bool optional = fieldDef.GetBool("Optional"); GroupValue exponentDef = fieldDef.GetGroup("Exponent"); GroupValue exponentOperatorDef = exponentDef.GetGroup("Operator").GetGroup(0); Operator exponentOperator = GetOperator(exponentOperatorDef.Group); ScalarValue exponentDefaultValue = ScalarValue.Undefined; if (exponentDef.IsDefined("InitialValue")) exponentDefaultValue = new IntegerValue(exponentDef.GetInt("InitialValue")); GroupValue mantissaDef = fieldDef.GetGroup("Mantissa"); GroupValue mantissaOperatorDef = mantissaDef.GetGroup("Operator").GetGroup(0); Operator mantissaOperator = GetOperator(mantissaOperatorDef.Group); ScalarValue mantissaDefaultValue = ScalarValue.Undefined; if (mantissaDef.IsDefined("InitialValue")) mantissaDefaultValue = new LongValue(mantissaDef.GetInt("InitialValue")); ComposedScalar composedDecimal = Util.ComposedDecimal(name, exponentOperator, exponentDefaultValue, mantissaOperator, mantissaDefaultValue, optional); IFieldValue retAuxId; if (fieldDef.TryGetValue("AuxId", out retAuxId) && retAuxId!=null) { composedDecimal.Id = retAuxId.ToString(); } return composedDecimal; }
public void SetLong(int fieldIndex, long value) { _values[fieldIndex] = new LongValue(value); }