Exemple #1
0
 public override FieldValue CreateValue(string value_Renamed)
 {
     return(type.GetValue(value_Renamed));
 }
Exemple #2
0
        public override Field Parse(System.Xml.XmlElement fieldNode, bool optional, ParsingContext context)
        {
            Operator.Operator operator_Renamed = Operator.Operator.NONE;
            string            defaultValue     = null;
            string            key = null;
            string            ns  = "";

            System.Xml.XmlElement operatorElement = GetOperatorElement(fieldNode);
            if (operatorElement != null)
            {
                if (operatorElement.HasAttribute("value"))
                {
                    defaultValue = operatorElement.GetAttribute("value");
                }
                operator_Renamed = Operator.Operator.GetOperator(operatorElement.Name);
                if (operatorElement.HasAttribute("key"))
                {
                    key = operatorElement.GetAttribute("key");
                }
                if (operatorElement.HasAttribute("ns"))
                {
                    ns = operatorElement.GetAttribute("ns");
                }
                if (operatorElement.HasAttribute("dictionary"))
                {
                    context.Dictionary = operatorElement.GetAttribute("dictionary");
                }
            }
            FASTType type   = GetType(fieldNode, context);
            var      scalar = new Scalar(GetName(fieldNode, context), type, operator_Renamed, type.GetValue(defaultValue), optional);

            if (fieldNode.HasAttribute("id"))
            {
                scalar.Id = fieldNode.GetAttribute("id");
            }
            if (key != null)
            {
                scalar.Key = new QName(key, ns);
            }
            scalar.Dictionary = context.Dictionary;
            ParseExternalAttributes(fieldNode, scalar);
            return(scalar);
        }