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;
        }
Beispiel #2
0
 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());
        }
Beispiel #4
0
 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;
     }
 }
Beispiel #5
0
 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;
     }
 }
Beispiel #6
0
        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;
            }
        }
Beispiel #7
0
 public PerformLookup(IXMLParser xmlParser, IXMLReader xmlReader)
 {
     this.xmlParser = xmlParser;
     this.xmlReader = xmlReader;
 }