コード例 #1
0
 public static void  SetNameAndId(Field field, GroupValue fieldDef)
 {
     SetName(field, fieldDef);
     if (field.Id != null)
     {
         fieldDef.SetString("AuxId", field.Id);
     }
 }
コード例 #2
0
 public static GroupValue CreateOperator(Scalar scalar)
 {
     MessageTemplate operatorTemplate;
     if (!OperatorTemplateMap.TryGetValue(scalar.Operator, out operatorTemplate))
         return null;
     GroupValue operatorMessage = new Message(operatorTemplate);
     if (!scalar.Dictionary.Equals(DictionaryFields.Global))
         operatorMessage.SetString("Dictionary", scalar.Dictionary);
     if (!scalar.Key.Equals(scalar.QName))
     {
         Group key = operatorTemplate.GetGroup("Key");
         var keyValue = new GroupValue(key);
         keyValue.SetString("Name", scalar.Key.Name);
         keyValue.SetString("Ns", scalar.Key.Namespace);
         operatorMessage.SetFieldValue(key, keyValue);
     }
     return operatorMessage;
 }
 public override GroupValue Convert(Field field, ConversionContext context)
 {
     var scalar = (Scalar) field;
     GroupValue fieldDef = base.Convert(field, context);
     if (scalar.HasAttribute(Error.FastConstants.LENGTH_FIELD))
     {
         var lengthDef = new GroupValue(fieldDef.GetGroup().GetGroup("Length"));
         lengthDef.SetString("Name", scalar.GetAttribute(Error.FastConstants.LENGTH_FIELD));
         fieldDef.SetFieldValue("Length", lengthDef);
     }
     return fieldDef;
 }
コード例 #4
0
 public override GroupValue Convert(Field field, ConversionContext context)
 {
     var scalar = (Scalar) field;
     GroupValue fieldDef = base.Convert(field, context);
     string value;
     if (scalar.TryGetAttribute(FastConstants.LengthField, out value))
     {
         var lengthDef = new GroupValue(fieldDef.Group.GetGroup("Length"));
         lengthDef.SetString("Name", value);
         fieldDef.SetFieldValue("Length", lengthDef);
     }
     return fieldDef;
 }
コード例 #5
0
        public override GroupValue Convert(Field field, ConversionContext context)
        {
            var        scalar   = (Scalar)field;
            GroupValue fieldDef = base.Convert(field, context);

            if (scalar.HasAttribute(Error.FastConstants.LENGTH_FIELD))
            {
                var lengthDef = new GroupValue(fieldDef.GetGroup().GetGroup("Length"));
                lengthDef.SetString("Name", scalar.GetAttribute(Error.FastConstants.LENGTH_FIELD));
                fieldDef.SetFieldValue("Length", lengthDef);
            }
            return(fieldDef);
        }
コード例 #6
0
        public override GroupValue Convert(Field field, ConversionContext context)
        {
            var        scalar   = (Scalar)field;
            GroupValue fieldDef = base.Convert(field, context);
            string     value;

            if (scalar.TryGetAttribute(FastConstants.LengthField, out value))
            {
                var lengthDef = new GroupValue(fieldDef.Group.GetGroup("Length"));
                lengthDef.SetString("Name", value);
                fieldDef.SetFieldValue("Length", lengthDef);
            }
            return(fieldDef);
        }
コード例 #7
0
        public static GroupValue CreateOperator(Scalar scalar)
        {
            if (!OPERATOR_TEMPLATE_MAP.Contains(scalar.Operator))
            {
                return(null);
            }
            var        operatorTemplate = (MessageTemplate)OPERATOR_TEMPLATE_MAP[scalar.Operator];
            GroupValue operatorMessage  = new Message(operatorTemplate);

            if (!scalar.Dictionary.Equals(Dictionary_Fields.GLOBAL))
            {
                operatorMessage.SetString("Dictionary", scalar.Dictionary);
            }
            if (!scalar.Key.Equals(scalar.QName))
            {
                var key      = operatorTemplate.GetGroup("Key");
                var keyValue = new GroupValue(key);
                keyValue.SetString("Name", scalar.Key.Name);
                keyValue.SetString("Ns", scalar.Key.Namespace);
                operatorMessage.SetFieldValue(key, keyValue);
            }
            return(operatorMessage);
        }
コード例 #8
0
        public static GroupValue CreateOperator(Scalar scalar)
        {
            MessageTemplate operatorTemplate;

            if (!OperatorTemplateMap.TryGetValue(scalar.Operator, out operatorTemplate))
            {
                return(null);
            }
            GroupValue operatorMessage = new Message(operatorTemplate);

            if (!scalar.Dictionary.Equals(DictionaryFields.Global))
            {
                operatorMessage.SetString("Dictionary", scalar.Dictionary);
            }
            if (!scalar.Key.Equals(scalar.QName))
            {
                Group key      = operatorTemplate.GetGroup("Key");
                var   keyValue = new GroupValue(key);
                keyValue.SetString("Name", scalar.Key.Name);
                keyValue.SetString("Ns", scalar.Key.Namespace);
                operatorMessage.SetFieldValue(key, keyValue);
            }
            return(operatorMessage);
        }
コード例 #9
0
 public static void SetNameAndId(Field field, GroupValue fieldDef)
 {
     SetName(field, fieldDef);
     if (!field.IsIdNull())
         fieldDef.SetString("AuxId", field.Id);
 }
コード例 #10
0
 public static void SetName(GroupValue fieldDef, QName qname)
 {
     fieldDef.SetString("Name", qname.Name);
     fieldDef.SetString("Ns", qname.Namespace);
 }
コード例 #11
0
 public static void  SetName(Field field, GroupValue fieldDef)
 {
     fieldDef.SetString("Name", field.Name);
     fieldDef.SetString("Ns", field.QName.Namespace);
 }
コード例 #12
0
 public static void SetName(GroupValue fieldDef, QName qname)
 {
     fieldDef.SetString("Name", qname.Name);
     fieldDef.SetString("Ns", qname.Namespace);
 }
コード例 #13
0
 public static GroupValue CreateOperator(Scalar scalar)
 {
     if (!OPERATOR_TEMPLATE_MAP.Contains(scalar.Operator))
         return null;
     var operatorTemplate = (MessageTemplate) OPERATOR_TEMPLATE_MAP[scalar.Operator];
     GroupValue operatorMessage = new Message(operatorTemplate);
     if (!scalar.Dictionary.Equals(Dictionary_Fields.GLOBAL))
         operatorMessage.SetString("Dictionary", scalar.Dictionary);
     if (!scalar.Key.Equals(scalar.QName))
     {
         var key = operatorTemplate.GetGroup("Key");
         var keyValue = new GroupValue(key);
         keyValue.SetString("Name", scalar.Key.Name);
         keyValue.SetString("Ns", scalar.Key.Namespace);
         operatorMessage.SetFieldValue(key, keyValue);
     }
     return operatorMessage;
 }
コード例 #14
0
 public static void SetName(Field field, GroupValue fieldDef)
 {
     fieldDef.SetString("Name", field.Name);
     fieldDef.SetString("Ns", field.QName.Namespace);
 }