Esempio n. 1
0
 private static IParser GetParser(ParsingTechnique ParsingTechnique)
 {
     return(ParsingTechnique switch
     {
         ParsingTechnique.XmlDocument => new XmlDocumentParser(),
         ParsingTechnique.XPathDocument => new XPathDocumentParser(),
         ParsingTechnique.XmlReader => new XmlReaderParser(),
         ParsingTechnique.Char => new CharParser(),
         _ => throw new NotImplementedException($"{ParsingTechnique} parsing technique not supported.")
     });
Esempio n. 2
0
        private static IParser GetParser(ParsingTechnique ParsingTechnique)
        {
            switch (ParsingTechnique)
            {
            case ParsingTechnique.XmlDocument:
                return(new XmlDocumentParser());

            case ParsingTechnique.XPathDocument:
                return(new XPathDocumentParser());

            case ParsingTechnique.XmlReader:
                return(new XmlReaderParser());

            case ParsingTechnique.Char:
                return(new CharParser());

            default:
                throw new NotImplementedException($"{ParsingTechnique} parsing technique not supported.");
            }
        }