Exemple #1
0
        private void ExecuteAllExecutors()
        {
            if (MainDescription.IsUIForm &&
                ControlExtended.UserCheck("确定启动执行器?", "警告信息"))

            {
                ExecuteDatas();
            }
        }
Exemple #2
0
        //public void AutoVisit()
        //{
        //    if (Documents.Any())
        //    {
        //        var item = new HttpItem();
        //        Documents[0].DictCopyTo(item);
        //        var res = helper != null && helper.AutoVisit(item);
        //        XLogSys.Print.Info("成功模拟登录");
        //        Http.SetValue("Cookie", item.GetValue("Cookie"));
        //        if (res)
        //        {
        //            URL = item.URL;
        //        }
        //    }
        //}

        private void GreatHand()
        {
            var crawitems = HtmlDoc.SearchPropertiesSmart(CrawlItems, IsAttribute).FirstOrDefault();

            if ((crawitems != null).SafeCheck("网页属性获取", LogType.Info) == false)
            {
                return;
            }


            var datas = HtmlDoc.GetDataFromXPath(crawitems, IsMultiData);

            var propertyNames = new FreeDocument(datas.GetKeys().ToDictionary(d => d, d => (object)d));

            datas.Insert(0, propertyNames);
            var view = PluginProvider.GetObjectInstance <IDataViewer>("可编辑列表");
            var r    = view.SetCurrentView(datas);


            var name   = "手气不错_可修改第一列的属性名称";
            var window = new Window {
                Title = name
            };

            window.Content  = r;
            window.Closing += (s, e) =>
            {
                if (ControlExtended.UserCheck("是否确认选择当前的数据表") == false)
                {
                    return;
                }

                foreach (var propertyName in propertyNames)
                {
                    var item = crawitems.FirstOrDefault(d => d.Name == propertyName.Key);
                    if (item == null)
                    {
                        continue;
                    }
                    if (propertyName.Value == null)
                    {
                        continue;
                    }
                    item.Name = propertyName.Value.ToString();
                }
                CrawlItems.Clear();
                CrawlItems.AddRange(crawitems);
            };


            window.ShowDialog();
        }
Exemple #3
0
        private void ExecuteAllExecutors()
        {
            bool   has_execute = CurrentETLTools.FirstOrDefault(d => d is IDataExecutor) != null;
            string info        = "确定启动执行器?";

            if (!has_execute)
            {
                info = info + "没有在主流程中发现执行器。";
            }
            if (MainDescription.IsUIForm &&
                ControlExtended.UserCheck(info, "警告信息"))

            {
                ExecuteDatas();
            }
        }