示例#1
0
        public override bool Init(IEnumerable <IFreeDocument> datas)
        {
            if (generator == null)
            {
                var mainstream =
                    processManager.CurrentProcessCollections.OfType <SmartETLTool>()
                    .FirstOrDefault(d => d.CurrentETLTools.Contains(this));
                generator = mainstream.CurrentETLTools.FirstOrDefault(d => d.Name == GEName) as BfsGE;
            }

            base.Init(datas);

            IsMultiYield = crawler?.IsMultiData == ListType.List;
            isfirst      = true;

            if (IsRegex)
            {
                regex = new Regex(Prefix);
            }
            return(crawler != null);
        }
示例#2
0
        public override bool Init(IEnumerable <IFreeDocument> datas)
        {
            if (generator == null)
            {
                var mainstream =
                    processManager.CurrentProcessCollections.OfType <SmartETLTool>()
                    .FirstOrDefault(d => d.CurrentETLTools.Contains(this));
                generator = mainstream.CurrentETLTools.FirstOrDefault(d => d.Name == GEName) as BfsGE;
            }

            crawler =
                processManager.CurrentProcessCollections.FirstOrDefault(d => d.Name == CrawlerSelector) as SmartCrawler;
            if (crawler != null)
            {
                IsMultiYield = crawler?.IsMultiData == ListType.List;
            }
            else
            {
                var task = processManager.CurrentProject.Tasks.FirstOrDefault(d => d.Name == CrawlerSelector);
                if (task == null)
                {
                    return(false);
                }
                ControlExtended.UIInvoke(() => { task.Load(false); });
                crawler =
                    processManager.CurrentProcessCollections.FirstOrDefault(d => d.Name == CrawlerSelector) as
                    SmartCrawler;
            }



            IsMultiYield = crawler?.IsMultiData == ListType.List;
            isfirst      = true;
            OneOutput    = false;
            if (IsRegex)
            {
                regex = new Regex(Prefix);
            }
            return(crawler != null && base.Init(datas));
        }