public void AddCrawlRule(ACrawlRule <TArachnodeDAO> crawlRule, CrawlRuleType crawlRuleType, bool isEnabled, int order) { //TODO: AssemblyName should be Namespace... crawlRule.AssemblyName = crawlRule.GetType().Namespace; crawlRule.CrawlRuleType = crawlRuleType; crawlRule.IsEnabled = isEnabled; crawlRule.Order = order; crawlRule.TypeName = crawlRule.GetType().FullName; CrawlRules.Add(crawlRule.TypeName, crawlRule); }
internal void LoadCrawlRules(IArachnodeDAO arachnodeDAO) { CrawlRules = new Dictionary <string, ACrawlRule <TArachnodeDAO> >(); foreach (ArachnodeDataSet.CrawlRulesRow crawlRulesRow in arachnodeDAO.GetCrawlRules()) { ObjectHandle objectHandle = Engine <TArachnodeDAO> .GetObjectHandle(crawlRulesRow.AssemblyName, crawlRulesRow.TypeName, _applicationSettings, _webSettings); ACrawlRule <TArachnodeDAO> crawlRule = (ACrawlRule <TArachnodeDAO>)objectHandle.Unwrap(); crawlRule.AssemblyName = crawlRulesRow.AssemblyName; crawlRule.IsEnabled = crawlRulesRow.IsEnabled; crawlRule.Order = crawlRulesRow.Order; crawlRule.OutputIsDisallowedReason = crawlRulesRow.OutputIsDisallowedReason; crawlRule.CrawlRuleType = (CrawlRuleType)Enum.Parse(typeof(CrawlRuleType), crawlRulesRow.CrawlRuleTypeID.ToString()); if (!crawlRulesRow.IsSettingsNull()) { crawlRule.Settings = crawlRulesRow.Settings; } crawlRule.TypeName = crawlRulesRow.TypeName; CrawlRules.Add(crawlRule.TypeName, crawlRule); } }