public ImportXMLCommand(IBookService bookService, IGenreService genreService, IProducerService producerService, IStudioService studioService, IXMLParser xmlParser) { if (bookService == null) { throw new ArgumentNullException("Book service cannnot be null."); } if (genreService == null) { throw new ArgumentNullException("Genre service cannnot be null."); } if (producerService == null) { throw new ArgumentNullException("Studio service cannnot be null."); } if (studioService == null) { throw new ArgumentNullException("Studio service cannnot be null."); } if (xmlParser == null) { throw new ArgumentNullException("XML parser cannnot be null."); } this.bookService = bookService; this.genreService = genreService; this.producerService = producerService; this.studioService = studioService; this.xMLParser = xmlParser; }
public TransactionFileParser( IXMLParser <Transaction> xMLParser, ICSVParser <Transaction> cSVParser) { _xMLParser = xMLParser; _cSVParser = cSVParser; }
public static void Main(string[] args) { IAbstractParserFactory parserFactory = ParserFactoryProducer.GetFactory("NYCFactory"); IXMLParser parser = parserFactory.GetParserInstance("NYCORDER"); Console.WriteLine(parser.Parse()); Console.WriteLine(Divider); parserFactory = ParserFactoryProducer.GetFactory("SFFactory"); parser = parserFactory.GetParserInstance("SFFEEDBACK"); Console.WriteLine(parser.Parse()); }
private void InitializeParser(string name) { if (name == "book") { xmlParser = new BookParser(); return; } if (name == "newspaper") { xmlParser = new NewspaperParser(); return; } if (name == "patent") { xmlParser = new PatentParser(); return; } }
public XMLParser(string parserSource) { switch (parserSource) { case Constant.SourceXML.BETCLICK: parser = new BetclickParser(); break; case Constant.SourceXML.PINNACLESPORTS: parser = new PinnacleSportsParser(); break; case Constant.SourceXML.TITANBET: parser = new CachefeedsParser(); break; default: parser = new CachefeedsParser(); break; } }
public PerformLookup(IXMLParser xmlParser, IXMLReader xmlReader) { this.xmlParser = xmlParser; this.xmlReader = xmlReader; }