Пример #1
0
        public void worker()
        {
            conf = MainForm.conf;

            List <string> urlsDone = new List <string>();

            string[] urls = conf.Urls.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            foreach (var url in urls)
            {
                if (!urlsDone.Contains(url))
                {
                    addInGui(extract(url, ref itemsCollection));

                    if (conf.recheckStepOne)
                    {
                        foreach (dynamic item in itemsCollection)
                        {
                            Hashtable ht = extract(item["itemUrl"], ref itemsCollection);
                            addInGui(ht);
                        }
                    }
                    urlsDone.Add(url);
                }
            }

            Globals.frmMain.Invoke((MethodInvoker)(() =>
            {
                Globals.frmMain.workFinish();
            }));
        }
Пример #2
0
        private void btn_load_Click(object sender, EventArgs e)
        {
            SaveConfig();
            ConfigObject co = new ConfigObject();

            co.Name = txt_configName.Text;
            co.Urls = txt_urls.Text;
            co.itemDescriptionIndices    = txt_itemDescriptionIndices.Text;
            co.itemsCollectionIndices    = txt_itemsColllectionIndices.Text;
            co.itemsImageIndices         = txt_itemImageIndices.Text;
            co.itemsNameIndices          = txt_itemNameIndices.Text;
            co.itemsUrlIndices           = txt_itemUrlIndices.Text;
            co.itemUrlSourceIndices      = txt_itemUrlSourceIndices.Text;
            co.nameAsUnique              = chk_nameAsUnique.Checked;
            co.recheckStepOne            = chk_reCheckStep1.Checked;
            co.itemPartCollectionIndices = txt_itemPartCollectionIndices.Text;
            co.itemPartNameIndices       = txt_itemPartNameIndices.Text;
            co.itemPartUrlSourceIndices  = txt_itemPartUrlSourceIndices.Text;
            MainForm.conf = co;

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Пример #3
0
        private void btn_loadConfig_Click(object sender, EventArgs e)
        {
            DialogResult result = new ConfigScrapForm().ShowDialog();

            if (result == DialogResult.OK) // Test result.
            {
                if (conf != null)
                {
                    txt_configName.Text = conf.Name;
                    btn_start.Enabled   = true;
                }
                else
                {
                    txt_configName.Text = "N/A";
                    btn_start.Enabled   = false;
                }
            }
            else
            {
                conf = null;
                txt_configName.Text = "N/A";
                btn_start.Enabled   = false;
            }
        }