public static IParserController GetController <ResultType>(string url, string source, ParserSettings settings, ParserType parserType) where ResultType : class { if (typeof(ResultType) == typeof(DataTable)) { try { return(new StringParserController( url, source, settings, parserType) as IParserController); } catch (NullReferenceException ex) { throw ex; } } else { throw new NotSupportedException("Не поддерживаемый тип парсера!"); } }
public StringParser(ParserSettings settings) { Settings = settings; }
public AgilityPackParser(ParserSettings settings) { Settings = settings; _document = new HtmlDocument(); _stringBuilder = new StringBuilder(); }
public AngleSharpParser(ParserSettings settings) { Settings = settings; }
public static IParserController <ResultType> GetController <ResultType>(string url, string source, ParserSettings settings) where ResultType : class { if (typeof(ResultType) == typeof(Dictionary <string, List <StringDictionary> >)) { try { return(new StringParserController( url, source, settings, new ParserDataController <Tag, TagAttribute, HttpResponce, Parsing>( new ParserRepository <Tag>(_contect) as IRepository <Tag>, new ParserRepository <TagAttribute>(_contect) as IRepository <TagAttribute>, new ParserRepository <HttpResponce>(_contect) as IRepository <HttpResponce>, new ParserRepository <Parsing>(_contect) as IRepository <Parsing> ) as IDataController <Dictionary <string, List <StringDictionary> > >) as IParserController <ResultType>); } catch (NullReferenceException ex) { throw ex; } } else { throw new NotSupportedException("Не поддерживаемый тип парсера!"); } }
public StringParserController(string url, string source, ParserSettings settings, IDataController <Dictionary <string, List <StringDictionary> > > dataController) : this(url, source, settings) { _dataController = dataController; }