Exemple #1
0
        /// <summary>
        /// 查找引用该模块的所有任务
        /// </summary>
        /// <param name="obj"></param>
        private void PrintReferenced(IDataProcess obj)
        {
            if (obj is SmartETLTool)
            {
                var tool     = obj as SmartETLTool;
                var oldtools = CurrentProcessCollections.OfType <SmartETLTool>().SelectMany(d => d.CurrentETLTools).OfType <ETLBase>().Where(d => d.ETLSelector.SelectItem == tool.Name).ToList();
                XLogSys.Print.Info("====================" + GlobalHelper.Get("smartetl_name") + "===================");
                foreach (var oldtool in oldtools)
                {
                    XLogSys.Print.Info(string.Format("{0} :{1}", oldtool.Father.Name, oldtool.ObjectID));
                }
            }
            if (obj is SmartCrawler)
            {
                var tool       = obj as SmartCrawler;
                var _name      = tool.Name;
                var oldCrawler = CurrentProcessCollections.OfType <SmartCrawler>()
                                 .Where(d => d.ShareCookie.SelectItem == _name).ToList();
                var oldEtls = CurrentProcessCollections.OfType <SmartETLTool>()
                              .SelectMany(d => d.CurrentETLTools).OfType <ResponseTF>()
                              .Where(d => d.CrawlerSelector.SelectItem == _name).ToList();
                XLogSys.Print.Info("====================" + GlobalHelper.Get("smartcrawler_name") + "=================");

                foreach (var oldtool in oldCrawler)
                {
                    XLogSys.Print.Info(string.Format("\t{0}", oldtool.Name));
                }
                XLogSys.Print.Info(GlobalHelper.Get("smartetl_name"));
                foreach (var oldtool in oldEtls)
                {
                    XLogSys.Print.Info(string.Format("{0} :{1}", oldtool.Father.Name, oldtool.ObjectID));
                }
            }
            XLogSys.Print.Info("======================================================================");
        }
Exemple #2
0
        public IEnumerable <IDataProcess> GetRevisedTasks()
        {
            foreach (var process in CurrentProcessCollections.OfType <AbstractProcessMethod>())
            {
                var task = CurrentProject.Tasks.FirstOrDefault(d => d.Name == process.Name);
                if (task == null)
                {
                    yield return(process);

                    continue;
                }
                if (!task.ProcessToDo.IsEqual(process.DictSerialize()))
                {
                    yield return(process);
                }
            }
        }
Exemple #3
0
        public T GetTask <T>(string name) where T : class, IDataProcess
        {
            var module = CurrentProcessCollections.OfType <T>().FirstOrDefault(d => d.Name == name);

            if (module != null)
            {
                return(module);
            }
            var project = GetRemoteProjectContent().Result;

            if (project != null)
            {
                var task    = project.Tasks.FirstOrDefault(d => d.TaskType == typeof(T).Name && d.Name == name);
                var newtask = task?.Load(false);
                return(newtask as T);
            }
            return(null);
        }