Ejemplo n.º 1
0
 public static Field[] ParseFieldInstructions(GroupValue groupDef, TemplateRegistry registry, ConversionContext context)
 {
     var instructions = groupDef.GetSequence("Instructions");
     var fields = new Field[instructions.Length];
     for (int i = 0; i < fields.Length; i++)
     {
         var fieldDef = instructions[i].GetGroup(0);
         var converter = context.GetConverter(fieldDef.GetGroup());
         if (converter == null)
         {
             throw new System.SystemException("Encountered unknown group " + fieldDef.GetGroup() + "while processing field instructions " + groupDef.GetGroup());
         }
         fields[i] = converter.Convert(fieldDef, registry, context);
     }
     return fields;
 }
Ejemplo n.º 2
0
        public static Field[] ParseFieldInstructions(GroupValue groupDef, TemplateRegistry registry, ConversionContext context)
        {
            var instructions = groupDef.GetSequence("Instructions");
            var fields       = new Field[instructions.Length];

            for (int i = 0; i < fields.Length; i++)
            {
                var fieldDef  = instructions[i].GetGroup(0);
                var converter = context.GetConverter(fieldDef.GetGroup());
                if (converter == null)
                {
                    throw new System.SystemException("Encountered unknown group " + fieldDef.GetGroup() + "while processing field instructions " + groupDef.GetGroup());
                }
                fields[i] = converter.Convert(fieldDef, registry, context);
            }
            return(fields);
        }
Ejemplo n.º 3
0
 public static Message Convert(Group group, Message groupMsg, ConversionContext context)
 {
     SetNameAndId(group, groupMsg);
     var instructions = new SequenceValue(SessionControlProtocol_1_1.TEMPLATE_DEFINITION.GetSequence("Instructions"));
     int i = group is MessageTemplate?1:0;
     Field[] fields = group.FieldDefinitions;
     for (; i < fields.Length; i++)
     {
         Field field = fields[i];
         FieldInstructionConverter converter = context.GetConverter(field);
         if (converter == null)
             throw new System.SystemException("No converter found for type " + field.GetType());
         FieldValue value_Renamed = converter.Convert(field, context);
         instructions.Add(new[]{value_Renamed});
     }
     groupMsg.SetFieldValue("Instructions", instructions);
     return groupMsg;
 }
Ejemplo n.º 4
0
        public static Message Convert(Group group, Message groupMsg, ConversionContext context)
        {
            SetNameAndId(group, groupMsg);
            var instructions = new SequenceValue(SessionControlProtocol_1_1.TEMPLATE_DEFINITION.GetSequence("Instructions"));
            int i            = group is MessageTemplate?1:0;

            Field[] fields = group.FieldDefinitions;
            for (; i < fields.Length; i++)
            {
                Field field = fields[i];
                FieldInstructionConverter converter = context.GetConverter(field);
                if (converter == null)
                {
                    throw new System.SystemException("No converter found for type " + field.GetType());
                }
                FieldValue value_Renamed = converter.Convert(field, context);
                instructions.Add(new[] { value_Renamed });
            }
            groupMsg.SetFieldValue("Instructions", instructions);
            return(groupMsg);
        }