示例#1
0
        public RawSegment(string value, Delimiters delims, LoopsList parentLoop, SegmentDefinition def)
        {
            FieldValues     = new List <List <string> >();
            ParsedValue     = value;
            delimiters      = delims;
            ParentLoopsList = parentLoop;
            ParentLoop      = parentLoop?.Last();
            DefiningSegment = def;

            var firstSplit = value.Split(delims.Element);

            foreach (string s in firstSplit)
            {
                var subs = new List <string>();
                if (s.Contains(delims.SubElement))
                {
                    subs = s.Split(delims.SubElement).ToList();
                }
                else
                {
                    subs.Add(s);
                }

                FieldValues.Add(subs);
            }
        }
示例#2
0
        public baseStdSegment CreateInstance(string value, Delimiters delims, LoopsList parentLoop)
        {
            var sg = (baseStdSegment)Activator.CreateInstance(SegmentType);

            sg.Prep(value, parentLoop, delims, this);
            //RawSegments.Add(sg.rawSegment);
            return(sg);
        }
示例#3
0
        public void Prep(string value, LoopsList parentLoop, Delimiters delims, SegmentDefinition def)
        {
            ParentLoops = parentLoop;
            Delimiter   = delims;
            DefinedSeg  = def;
            ParentLoop  = ParentLoops?.Last();

            rawSegment = new RawSegment(value, Delimiter, ParentLoops, DefinedSeg);
        }
示例#4
0
 public baseStdSegment(string value, LoopsList parentLoop, Delimiters delims, SegmentDefinition def)
 {
     Prep(value, parentLoop, delims, def);
 }