Exemplo 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;
 }
Exemplo 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);
        }
Exemplo n.º 3
0
        public static Field[] ParseFieldInstructions(GroupValue groupDef, ITemplateRegistry registry,
                                                     ConversionContext context)
        {
            SequenceValue instructions = groupDef.GetSequence("Instructions");
            var fields = new Field[instructions.Length];
            for (int i = 0; i < fields.Length; i++)
            {
                GroupValue fieldDef = instructions[i].GetGroup(0);
                IFieldInstructionConverter converter = context.GetConverter(fieldDef.Group);
                if (converter == null)
                    throw new SystemException(
                        string.Format("Encountered unknown group {0} while processing field instructions {1}",
                                      fieldDef.Group, groupDef.Group));

                fields[i] = converter.Convert(fieldDef, registry, context);
            }
            return fields;
        }