public xpathAttributeGroupPP(string attrId,IntelliScraper.Db.xpathSingle rule)       
 {
     this.attrId = attrId;
     this.rule = rule;
     InitializeComponent();
     load();
 }
        public void load(IntelliScraper.Db.imageConvert rule)
        {

            this.rule = rule;

             cmbConvertType.Items.Clear();
            foreach(string s in Enum.GetNames(typeof(IntelliScraper.Db.imageConvertConvertType)))
                cmbConvertType.Items.Add(s);


            if (this.rule != null)
            {
                txtId.Text = this.rule.id;
                chkConvertFormat.IsChecked = this.rule.convertToFormat;
                chkResize.IsChecked = this.rule.changeSize;
                txtWidht.Text = this.rule.toSizew.ToString();
                txtHeight.Text = this.rule.toSizeH.ToString();
                chkCreateThumbs.IsChecked = this.rule.createThumbs;
                chkCreateThumbFolder.IsChecked = this.rule.createThumbFolder;
                if (rule.Thumbs != null)
                    listViewThumbs.ItemsSource = rule.Thumbs;

                cmbConvertType.SelectedValue = rule.convertType.ToString();
            }
            else
            {
                this.rule = new IntelliScraper.Db.imageConvert();
                
            }
                 
        }
 public xpathAttribute(string attrId,IntelliScraper.Db.xpathSingle rule,bool isFromXpathCollection,IntelliScraper.Db.xpathCollection coll)
 {
     this.isFromXpathCollection = isFromXpathCollection;
     this.coll = coll;
     this.rule = rule;
     this.ruleId = rule.id;
     this.attrId = attrId;
     InitializeComponent();
     load();
 }
Example #4
0
        /// <summary>
        /// Serialize input xml file
        /// </summary>
        /// <returns></returns>
        public static IntelliScraper.Db.intelliScraper DeSerialize(IntelliScraper.Db.intelliScraper i,string file)
        {

            XmlSerializer serializer = new XmlSerializer(typeof(IntelliScraper.Db.intelliScraper));           
            using (Stream reader = new FileStream(file, FileMode.Open))
            {
                serializer.Serialize(reader, i);
            }
            return i;
        }
Example #5
0
        public SubString(IntelliScraper.Db.substring rule)
        {
            this.rule = rule;
            InitializeComponent();
            load();

            txtSSimple.PreviewTextInput += new TextCompositionEventHandler(txtThreadNum_PreviewTextInput);
            txtSfrom.PreviewTextInput += new TextCompositionEventHandler(txtThreadNum_PreviewTextInput);
            txtSTo.PreviewTextInput += new TextCompositionEventHandler(txtThreadNum_PreviewTextInput);
        }
Example #6
0
        public static object getRuleObject(string name, IntelliScraper.Db.intelliScraperActionType type)
        {
            List<object> o = new List<object>();
            if (type == IntelliScraper.Db.intelliScraperActionType.httpGet)
                o = IntelliScraper.Factory.Instance.i.rules.httpGet.ToList<object>();

            if (o != null)
                return (from x in o where (string)x.GetType().GetProperty("id").GetValue(x, null) == name select x).FirstOrDefault();
            
            return null;
        }
 public void load(IntelliScraper.Db.HttpHeadersInfoCollection headers)
 {
     if (headers != null)
     {
         this.headers = headers;
         if (Factory.Instance.i.Project.ScrapingSetting.GlobalHttpHeadersInfo != null)
         {
             //var sequence = Factory.Instance.i.Project.ScrapingSetting.GlobalHttpHeadersInfo;
             listViewHttpHeaders.ItemsSource = this.headers;
         }
     }
     else this.headers = new IntelliScraper.Db.HttpHeadersInfoCollection();
 }
 public StartEndWith(IntelliScraper.Db.startEndWith rule)
 {
     InitializeComponent();
     this.rule = rule;
     load();
 }
Example #9
0
 public HttpGet(IntelliScraper.Db.httpGet rule)
 {
     this.rule = rule;
 }
 public void refresh(IntelliScraper.Db.imageConvert rule)
 {
     this.rule = rule;
 }
Example #11
0
 public Trim(IntelliScraper.Db.trim rule)
 {
     this.rule = rule;
     InitializeComponent();
     load();
 }
Example #12
0
 public Append(IntelliScraper.Db.append rule)
 {
     InitializeComponent();
     this.rule = rule;
     load();
 }
        public void load(string id,bool isFromCollection,IntelliScraper.Db.xpathCollection coll)
        {
            this.id = id;
            this.isFromCollection = isFromCollection;
            this.coll = coll;
            treeView1.Items.Clear();
            if (!string.IsNullOrEmpty(id))
            {
                this.id = id;
                if (!isFromCollection)
                {
                    if (Factory.Instance.i.rules.xpathSingle != null)
                        this.rule = (from x in Factory.Instance.i.rules.xpathSingle where x.id == id select x).FirstOrDefault();
                }
                else
                {
                    if(coll.xpathSingle != null)
                        this.rule = coll.xpathSingle;// (from x in coll.xpathSingle where x.id == id select x).FirstOrDefault();
                }
            }

            if (this.rule != null)
            {
                
                this.ruleName.Text = rule.id;
                TreeViewItem attributesT = new TreeViewItem();
                attributesT.Header = "Attributes";
                attributesT.IsExpanded = true;


                if (rule.attributes != null)
                {
                    foreach (IntelliScraper.Db.xpathSingleAttributes attr in rule.attributes)
                    {
                        TreeViewItem i = new TreeViewItem();
                        i.Header = attr.id;
                        attributesT.Items.Add(i);
                        i.MouseUp += new MouseButtonEventHandler(i_MouseUp);
                        i.ContextMenu = Resources["cMenu"] as ContextMenu;

                    }                    
                }
                treeView1.Items.Add(attributesT);

                
                if (rule.postProcessTriggerGroup != null)
                {
                    TreeViewItem ppGr = new TreeViewItem();
                    ppGr.Header = "Post Process Group Rule";
                    ppGr.IsExpanded = true;
                    foreach (var r in rule.postProcessTriggerGroup)
                    {
                        TreeViewItem piT = new TreeViewItem();
                        piT.Header = r.id;
                        piT.Tag = "groupPP";
                        ppGr.Items.Add(piT);
                        piT.MouseUp += new MouseButtonEventHandler(piT_MouseUp);
                        piT.ContextMenu = Resources["grMenu"] as ContextMenu;
                    }
                    treeView1.Items.Add(ppGr);
                }

                
               
            }

            //Load Process data
            List<string> ppId = new List<string>();
            foreach (var o in Factory.Instance.getAllPostProcessObj())
            {
                string _id = (string)o.GetType().GetProperty("id").GetValue(o, null);
              
            }

            
        }
Example #14
0
 public Replace(IntelliScraper.Db.replace rule)
 {
     this.rule = rule;
     InitializeComponent();
     load();
 }
 public HtmlEncodeDecode(IntelliScraper.Db.htmlEncodeDecode rule)
 {
     InitializeComponent();
     this.rule = rule;
     load();
 }
Example #16
0
 public Regex(IntelliScraper.Db.regularExpression rule)
 {
     this.rule = rule;
     InitializeComponent();
     load();
 }