Example #1
0
        private void LoadFrom(ITextFileReader reader)
        {
            var inMergeSection = false;
            var mergeMarger    = Constants.MERGE_MARKER.ToLower().Trim().Replace(" ", string.Empty);

            reader.EnumerateLines()
            .ForEach(line =>
            {
                if (inMergeSection && string.IsNullOrWhiteSpace(line))
                {
                    return;
                }
                if (line.Trim().ToLower().Replace(" ", string.Empty) == mergeMarger)
                {
                    inMergeSection = true;
                    return;
                }
                if (inMergeSection)
                {
                    AddMergeLine(line);
                }
                else
                {
                    AddPrimaryLine(line);
                }
            });
            reader.Dispose();
        }
Example #2
0
 public void Merge(ITextFileReader reader)
 {
     reader.EnumerateLines()
     .ForEach(AddMergeLine);
 }