Example #1
0
 public MappingPair(List <string> source_keys, List <string> target_keys)
 {
     Source = new TextEditSelector();
     Target = new TextEditSelector();
     Source.SetSource(source_keys);
     Target.SetSource(target_keys);
 }
Example #2
0
        public XPathDetectorModel(IEnumerable <HtmlResult> htmlResults, ScriptWorkMode workmode, Window theView,
                                  TextBox textbox)
        {
            HtmlDoc = new HtmlDocument();
            var xpathHelper = new Dictionary <string, string>
            {
                { "all_image", "//img[@src]" },
                { "all_item_with_id", @"//*[@id=""YOUR_ID""]" },
                { "all_item_with_class", @"//*[@class=""YOUR_CLASS""]" }
            };

            HtmlResults = htmlResults.ToList();
            view        = theView;
            htmlTextBox = textbox;
            XPath       = new TextEditSelector();
            XPath.SetSource(xpathHelper.Select(d => d.Value));
            if (workmode == ScriptWorkMode.List)
            {
                ChildCount = 5;
            }
            else
            {
                ChildCount = 1;
            }
            CrawlItems     = new ObservableCollection <CrawlItem>();
            ChildItems     = new ObservableCollection <CrawlItem>();
            SelectedResult = HtmlResults.FirstOrDefault();
        }
Example #3
0
        public DbEX()
        {
            dataManager = MainDescription.MainFrm.PluginDictionary["DataManager"] as IDataManager;


            ConnectorSelector          = new ExtendSelector <IDataBaseConnector>();
            ConnectorSelector.GetItems = () => dataManager.CurrentConnectors.ToList();
            TableNames = new TextEditSelector();
            ConnectorSelector.SelectChanged +=
                (s, e) => TableNames.SetSource(ConnectorSelector.SelectItem.RefreshTableNames().Select(d => d.Name));
            TableNames.SelectChanged += (s, e) => { InformPropertyChanged("TableNames"); };
        }