예제 #1
0
        public IEnumerable <OrderValidatable> Read()
        {
            using (var stream = GetFileStream(FileMode.Open))
                using (var reader = new StreamReader(stream))
                {
                    IOrderParser parser = null;

                    string line;

                    var isFirstLine = true;

                    while ((line = reader.ReadLine()) != null)
                    {
                        if (isFirstLine)
                        {
                            isFirstLine = false;

                            parser = _parserFactory.Invoke(line.Split('\t'));
                        }
                        else
                        {
                            yield return(parser.Parse(line));
                        }
                    }
                }
        }
예제 #2
0
 ///<exception cref = "NoParserException" />
 public ProfileParser(string profilePath)
 {
     _parser = GetParser(profilePath);
 }
예제 #3
0
 public FileWatcher(IOrderParser parser, IOrderOutputter outputter)
 {
     this.parser    = parser;
     this.outputter = outputter;
 }
예제 #4
0
 public OrderLoader(IOrderParser orderParser, IFileSystem fileSystem)
 {
     this.orderParser = orderParser;
     this.fileSystem  = fileSystem;
 }