Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConverterService"/> class.
 /// </summary>
 /// <param name="parser">The parser.</param>
 /// <param name="htmlParser">The HTML parser.</param>
 /// <param name="builder">The builder.</param>
 /// <param name="config">The configuration.</param>
 public ConverterService(IJsonConverter parser, IHTMLConverter htmlParser, IBuilder <ITree> builder, ConvertConfig config)
 {
     _config     = config;
     _parser     = parser;
     _htmlParser = htmlParser;
     _builder    = builder;
 }
Example #2
0
        public ITree ToConverted(string html)
        {
            _map = ConvertConfig.GetMapping();
            CleanToCompatible(ref html);
            ToDictionary(html);

            _tomlTree = _builder.ToDictionary(_config.Toml.BaseToml);
            RemoveModule(_tomlTree, false);
            //RemoveArrays(_tomlTree);
            MergeValues();
            RemoveSkeletons(_tomlTree);
            return(_tomlTree);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DictionaryConverter"/> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public DictionaryConverter(ConvertConfig config)
 {
     _config   = config;
     _omitKeys = _config.Rules.Where(o => o.Schema == ConversionScheme.Omit).ToList();
 }
Example #4
0
 /// <summary>
 /// Updates the configuration.
 /// </summary>
 /// <param name="properties">The properties.</param>
 /// <returns></returns>
 public async Task <bool> UpdateConfig(string properties)
 {
     return(await ConvertConfig.UpdateConfiguration(properties));
 }
Example #5
0
 public TomlBuilder(ConvertConfig config)
 {
     _config = config;
 }
Example #6
0
 public Extractor(ConvertConfig config)
 {
     _config = config;
 }
Example #7
0
 public HTMLConverter(ConvertConfig config, IBuilder <ITree> builder)
 {
     _config  = config;
     _tree    = new Tree();
     _builder = builder;
 }