Exemple #1
0
        private void CreatePattern(Type patternType, ParameterizableConfigurationElement patternConfiguration, Data.Matcher matcher)
        {
            PatternBase pattern = ConfigurableBase.CreateConfigurableItem <PatternBase>(patternType, patternConfiguration != null ? patternConfiguration.Parameters : null);

            pattern.Configuration = ConfigurationFactory.GetConfiguration(patternConfiguration, matcher);

            _patterns.Add(pattern);
        }
Exemple #2
0
        private void CreateChecker(Type checkerType, ParameterizableConfigurationElement checkerConfiguration, Validator validator)
        {
            CheckerBase checker = ConfigurableBase.CreateConfigurableItem <CheckerBase>(checkerType, checkerConfiguration != null ? checkerConfiguration.Parameters : null);

            checker.Arrangement = ArrangementFactory.GetArrangement(checkerConfiguration, validator);

            _checkers.Add(checker);
        }
Exemple #3
0
        private void initializeLeechers()
        {
            if (_leechers == null)
            {
                _leechers = new List <LeecherBase>();

                foreach (LeecherElement leecherConfiguration in AcroniManagerConfigurationSection.Instance.Leechers)
                {
                    Type leecherType = ConfigurableBase.GetType(leecherConfiguration.Class, typeof(LeecherBase), "leecher");

                    Crawler crawler = CrawlerFactory.GetCrawler(leecherConfiguration);

                    foreach (ExecutionElement executionConfiguration in leecherConfiguration.Executions)
                    {
                        ValidateConfiguration(executionConfiguration);
                        LeecherBase leecher = ConfigurableBase.CreateConfigurableItem <LeecherBase>(leecherType, executionConfiguration.Parameters);
                        leecher.Execution = ExecutionFactory.GetExecution(executionConfiguration, crawler);
                        _leechers.Add(leecher);
                    }
                }
            }
        }