Пример #1
0
        public void StartVisit()
        {
            if (IsRunning)
            {
                return;
            }
            if (string.IsNullOrEmpty(URLFilter) && string.IsNullOrEmpty(this.ContentFilter))
            {
                MessageBox.Show("请填写至少填写URL前缀或关键字中一项过滤规则");
                return;
            }
            ControlExtended.SafeInvoke(() =>
            {
                if (CanSave)
                {
                    Documents.Clear();
                }
                var url = URL;
                if (url.StartsWith("http") == false)
                {
                    url = "http://" + url;
                }

                System.Diagnostics.Process.Start(url);
                FiddlerApplication.BeforeResponse += FiddlerApplicationAfterSessionComplete;
                FiddlerApplication.Startup(8888, FiddlerCoreStartupFlags.Default);
                IsRunning = FiddlerApplication.IsStarted();
                OnPropertyChanged("IsRunning");
            }, LogType.Important, "尝试启动服务");
        }
Пример #2
0
        private void CreateModuleProject()
        {
            var refs = CollectReferencedAssemblies();

            var moduleProjectName = "RuntimeModule";

            var moduleProjectID = ProjectId.CreateNewId();

            var versionStamp = VersionStamp.Create();

            var projInfo = ProjectInfo.Create(moduleProjectID, versionStamp, moduleProjectName, moduleProjectName,
                                              LanguageNames.CSharp,
                                              compilationOptions: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));

            projInfo = projInfo.WithMetadataReferences(refs);

            Workspace.AddProject(projInfo);

            //取得所有用户定义的业务类型,并生成文档.
            var businessObjects = this.objectSpace.GetObjectsQuery <BusinessObjectBase>().Where(x => x.IsRuntimeDefine);

            CreateAssembyInfoDocument();
            CreateRuntimeModule();
            Documents.Clear();
            foreach (var bo in businessObjects)
            {
                CreateDocument(bo);
            }
        }
Пример #3
0
        private void OnClearDocs(object param)
        {
            Documents.Clear();
            SelectedDocument = null;

            IO.FileIO.Cleanup();
            //Toolbox.RemoveTemporaryFiles();
        }
Пример #4
0
        public void Clear()
        {
            if (Documents == null)
            {
                return;
            }

            Documents.Clear();
        }
Пример #5
0
        private void CreateModuleProject()
        {
            var refs = CollectReferencedAssemblies();

            var moduleProjectName = "RuntimeModule";

            var moduleProjectID = ProjectId.CreateNewId();

            var versionStamp = VersionStamp.Create();

            var projInfo = ProjectInfo.Create(moduleProjectID, versionStamp, moduleProjectName, moduleProjectName,
                                              LanguageNames.CSharp,
                                              compilationOptions: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));

            projInfo = projInfo.WithMetadataReferences(refs);

            Workspace.AddProject(projInfo);

            //取得所有用户定义的业务类型,并生成文档.
            var businessObjects = this.objectSpace.GetObjects <BusinessObject>(new BinaryOperator("IsRuntimeDefine", true));

            CreateAssembyInfoDocument();
            CreateRuntimeModule();
            Documents.Clear();
            foreach (var bo in businessObjects)
            {
                CreateDocument(bo);
            }

            var partialLogics = this.objectSpace.GetObjects <BusinessObjectPartialLogic>(null, true);

            foreach (var logic in partialLogics)
            {
                CreateDocument(logic);
            }
            var flowactions = this.objectSpace.GetObjects <FlowAction>(null, true);

            foreach (var flowacion in flowactions)
            {
                CreateDocument(flowacion);
            }
            var layouts = this.objectSpace.GetObjects <BusinessObjectLayout>();

            foreach (var item in layouts)
            {
                CreateDocument(item);
            }
            var controllers = this.objectSpace.GetObjects <RuntimeController>(null, true);

            foreach (var item in controllers)
            {
                CreateDocument(item);
            }
        }
Пример #6
0
        public void ResetLayout()
        {
            Documents.Clear();
            _Tools.Clear();

            HomeViewModel hvm = new HomeViewModel();

            Documents.Add(hvm);

            _Tools.Add(new ExplorerViewModel());
            _Tools.Add(new TocViewModel());
            _Tools.Add(new DriveExplorerViewModel());
        }
Пример #7
0
        private void UpdateList()
        {
            Documents.Clear();

            Documents.Add(new Document("test", true, User.Name.Value, true));

            UserDocumentCount.Value = Documents.Count(c => c.UserName == User.Name.Value);

            //自分のユーザーファイル
            //共有ファイル
            //他人のユーザーファイル

            //セッションはすべてQuitする
        }
        private async void ValidateResponseDocuments(ResponseDocuments response)
        {
            Documents.Clear();
            if (response.Success)
            {
                Documents.Add(response.Documents.Where(x => x.Code == DocumentType).FirstOrDefault());
                DocumentSelected = response.Documents.Where(x => x.Code == DocumentType).FirstOrDefault();
                return;
            }

            await dialogService.ShowMessage(response.Title, response.Message);

            await navigationService.Back();
        }
Пример #9
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects).
                }

                MessageDataProcessor = null;
                Documents.Clear();

                disposedValue = true;
            }
        }
Пример #10
0
        protected override void DoUnload()
        {
            Documents.Added    -= Documents_Changed;
            Documents.Removed  -= Documents_Changed;
            References.Added   -= References_Changed;
            References.Removed -= References_Changed;

            foreach (var doc in Documents)
            {
                doc.Unload();
            }

            Documents.Clear();
            References.Clear();
        }
Пример #11
0
        public async Task <bool> NextPageAsync()
        {
            Documents.Clear();

            if (GetNextPageFunc == null)
            {
                Page = -1;
                return(false);
            }

            var results = await GetNextPageFunc(this).AnyContext();

            Documents.AddRange(results.Documents);

            return(Documents.Count > 0);
        }
Пример #12
0
        public void ImportDocuments()
        {
            // Clear Documents
            Documents.Clear();
            FilteredDocuments.Clear();

            foreach (Craft c in Crafts)
            {
                // return a List of Documents
                var tmpDocs = Document.Import(c);

                foreach (Document d in tmpDocs)
                {
                    Documents.Add(d);
                }
            }
        }
Пример #13
0
        public async Task LoadDocuments()
        {
            dialogService.ShowProgress();
            ResponseDocuments response = await apiService.GetDocuments(new RequestDocument());

            dialogService.HideProgress();
            Documents.Clear();
            if (response.Success && response.Documents != null)
            {
                foreach (Document item in response.Documents)
                {
                    Documents.Add(item);
                }
                return;
            }

            await dialogService.ShowMessage(response.Message, response.Title);
        }
        private async Task LoadDocuments(bool cleanContent = false)
        {
            try
            {
                IsRunning = true;

                if (cleanContent)
                {
                    Documents.Clear();
                    ContinuationToken = null;
                }

                var list = await _dbService.GetDocumentsAsync(Connection,
                                                              Collection,
                                                              Filter,
                                                              Settings.Default.MaxDocumentToRetrieve,
                                                              ContinuationToken,
                                                              this)
                           .ConfigureAwait(true);

                HasMore           = list.HasMore;
                ContinuationToken = list.ContinuationToken;
                RequestCharge     = $"Request Charge: {list.RequestCharge:N2}";

                foreach (var document in list)
                {
                    Documents.Add(document);
                }

                RaisePropertyChanged(() => ItemsCount);
            }
            catch (DocumentClientException clientEx)
            {
                await _dialogService.ShowError(clientEx.Parse(), "Error", "ok", null).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                await _dialogService.ShowError(ex, "Error", "ok", null).ConfigureAwait(false);
            }
            finally
            {
                IsRunning = false;
            }
        }
Пример #15
0
        private void OnPerformSearch(object obj)
        {
            var items = new List <IDocumentHistoryItem>(_originalDocumentHistoryItems);

            if (!string.IsNullOrEmpty(SearchTerm))
            {
                switch (SearchFilters.IndexOf(SelectedSearchFilter))
                {
                case 0:
                case 5:
                    items.Remove(item => item.RegistrationNumber == null || !item.RegistrationNumber.ToLower().Contains(SearchTerm.ToLower()));
                    break;

                case 1:
                    items.Remove(item => item.CustomerContact == null || !item.CustomerContact.ToLower().Contains(SearchTerm.ToLower()));
                    break;

                case 2:
                    items.Remove(item => item.TechnicianName == null || !item.TechnicianName.ToLower().Contains(SearchTerm.ToLower()));
                    break;

                case 3:
                    items.Remove(item => item.Office == null || !item.Office.ToLower().Contains(SearchTerm.ToLower()));
                    break;

                case 4:
                    items.Remove(item => item.DocumentType == null || !item.DocumentType.ToLower().Contains(SearchTerm.ToLower()));
                    break;
                }
            }

            if (SelectedDocumentType != Resources.TXT_SELECT_ALL && SelectedDocumentType != Resources.TXT_ANALOGUE_ONLY)
            {
                items.Remove(item => item.Type != SelectedDocumentType);
            }

            if (SelectedDocumentType == Resources.TXT_ANALOGUE_ONLY)
            {
                items.Remove(item => item.Document == null || !(item.Document is TachographDocument) || ((TachographDocument)item.Document).IsDigital);
            }

            Documents.Clear();
            Documents.AddRange(items);
        }
        public async Task LoadDocuments()
        {
            dialogService.ShowProgress();
            ResponseDocumentRegister response = await apiService.GetDocumentTypesRegister(new RequestDocumentRegister());

            dialogService.HideProgress();
            Documents.Clear();

            if (response.Success == false || response.StatusCode != 0)
            {
                await dialogService.ShowMessage(response.Title, !string.IsNullOrEmpty(response.Message)?response.Message : response.ErrorMessage);

                return;
            }

            foreach (Document item in response.Documents)
            {
                Documents.Add(item);
            }
        }
Пример #17
0
        private void RemoveMergeRows()
        {
            foreach (var button in Buttons)
            {
                Controls.Remove(button);
            }

            foreach (var label in Labels)
            {
                Controls.Remove(label);
            }

            foreach (var txtBox in Textboxes)
            {
                Controls.Remove(txtBox);
            }

            Buttons.Clear();
            Labels.Clear();
            Textboxes.Clear();
            Documents.Clear();
        }
Пример #18
0
        /// <summary>
        /// Метод обрабатывающий документы в дополнительном потоке
        /// </summary>
        /// <param name="sender">отправитель</param>
        /// <param name="e">аргументы</param>
        void Worker_DoWork(object sender, DoWorkEventArgs e)
        {
            DocumentsVisibility   = false; // Сокрытие коллекции документов
            ProgressBarVisibility = true;  // Отображение прогресс бара

            try
            {
                // Обработка документа(документов)
                textHandlerService.HandleDocuments(Documents.ToList(), dialogService.FolderPath, new Options(RemovePunctuationMarks, MinWordLength));
            }
            catch (Exception ex)
            {
                success = false;

                //Используем Dispatcher для выполнения метода в потоке UI
                mainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                                                  (ThreadStart) delegate
                {
                    Documents.Clear();
                    dialogService.ShowErrorMessage(mainWindow, ex.Message);
                });
            }
        }
Пример #19
0
        async Task GetDocuments()
        {
            if (IsBusy)
            {
                return;
            }

            Exception error = null;

            try
            {
                IsBusy = true;


                var items = await DataStore.GetItemsAsync();

                Documents.Clear();
                foreach (var item in items)
                {
                    Documents.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error: " + ex);
                error = ex;
            }
            finally
            {
                IsBusy = false;
            }

            if (error != null)
            {
                await Application.Current.MainPage.DisplayAlert("Error!", error.Message, "OK");
            }
        }
Пример #20
0
        public void RefreshSamples(bool canGetDatas = true)
        {
            if (SysProcessManager == null)
            {
                return;
            }
            if (!mudoleHasInit)
            {
                return;
            }
            if (SysProcessManager.CurrentProcessTasks.Any(d => d.Publisher == this))
            {
                XLogSys.Print.WarnFormat("{0}已经有任务在执行,请在执行完毕后再刷新,或取消该任务", Name);
                return;
            }
            if (dataView == null && MainDescription.IsUIForm && IsUISupport)
            {
                var dock    = MainFrm as IDockableManager ?? ControlExtended.DockableManager;
                var control = dock?.ViewDictionary.FirstOrDefault(d => d.Model == this);
                if (control != null)
                {
                    if (control.View is IRemoteInvoke)
                    {
                        var invoke = control.View as IRemoteInvoke;
                        invoke.RemoteFunc = DropAction;
                    }
                    dynamic dy = control.View;

                    dataView     = dy.DataList;
                    scrollViewer = dy.ScrollViewer;

                    alltoolList            = dy.ETLToolList;
                    alltoolList.MouseMove += (s, e) =>
                    {
                        if (e.LeftButton == MouseButtonState.Pressed)
                        {
                            var attr = alltoolList.SelectedItem as XFrmWorkAttribute;
                            if (attr == null)
                            {
                                return;
                            }

                            var data = new DataObject(typeof(XFrmWorkAttribute), attr);
                            try
                            {
                                DragDrop.DoDragDrop(control.View as UserControl, data, DragDropEffects.Move);
                            }
                            catch (Exception ex)
                            {
                            }
                        }
                    };
                }
            }
            Documents.Clear();

            var alltools = CurrentETLTools.Take(ETLMount).ToList();
            var hasInit  = false;
            var func     = Aggregate(d => d, alltools, false);

            if (!canGetDatas)
            {
                return;
            }
            var temptask = TemporaryTask.AddTempTask(Name + "_转换",
                                                     func(new List <IFreeDocument>()).Take(SampleMount),
                                                     data =>
            {
                ControlExtended.UIInvoke(() =>
                {
                    Documents.Add((data));
                    if (hasInit == false && Documents.Count > 2)
                    {
                        InitUI();
                        hasInit = true;
                    }
                });
            }, d =>
            {
                if (!hasInit)
                {
                    InitUI();
                    hasInit = true;
                }
            }
                                                     , SampleMount);

            temptask.Publisher = this;
            SysProcessManager.CurrentProcessTasks.Add(temptask);
        }
Пример #21
0
        /// <summary>
        /// Fetch documents from enumerator and add to buffer. If cache recycle, stop read to execute in another read
        /// </summary>
        public void Fetch(TransactionService trans, DataService data, BsonReader bsonReader)
        {
            // empty document buffer
            Documents.Clear();

            // while until must cache not recycle
            while (trans.CheckPoint() == false)
            {
                // read next node
                HasMore = _nodes.MoveNext();

                // if finish, exit loop
                if (HasMore == false)
                {
                    return;
                }

                // if run ONLY under index, skip/limit before deserialize
                if (_query.UseIndex && _query.UseFilter == false)
                {
                    if (--_skip >= 0)
                    {
                        continue;
                    }

                    if (--_limit <= -1)
                    {
                        HasMore = false;
                        return;
                    }
                }

                // get current node
                var node = _nodes.Current;

                // read document from data block
                var buffer = data.Read(node.DataBlock);
                var doc    = bsonReader.Deserialize(buffer).AsDocument;

                // if need run in full scan, execute full scan and test return
                if (_query.UseFilter)
                {
                    // execute query condition here - if false, do not add on final results
                    if (_query.FilterDocument(doc) == false)
                    {
                        continue;
                    }

                    // implement skip/limit after deserialize in full scan
                    if (--_skip >= 0)
                    {
                        continue;
                    }

                    if (--_limit <= -1)
                    {
                        HasMore = false;
                        return;
                    }
                }

                // increment position cursor
                _position++;

                // avoid lock again just to check limit
                if (_limit == 0)
                {
                    HasMore = false;
                }

                Documents.Add(doc);
            }
        }
Пример #22
0
 public void Clear()
 {
     Documents.Clear();
 }
Пример #23
0
 /// <summary>
 /// Clears the content panel
 /// </summary>
 public void Clear()
 {
     Content = null;
     Documents.Clear();
     State = DocumentContainerState.Empty;
 }
Пример #24
0
        /// <summary>
        /// Executes the engine. This is the primary method that kicks off generation.
        /// </summary>
        public async Task ExecuteAsync(CancellationTokenSource cancellationTokenSource)
        {
            // Remove the synchronization context
            await default(SynchronizationContextRemover);

            CheckDisposed();

            _logger.LogInformation($"Using {JsEngineSwitcher.Current.DefaultEngineName} as the JavaScript engine");

            // Make sure we've actually configured some pipelines
            if (_pipelines.Count == 0)
            {
                _logger.LogWarning("No pipelines are configured.");
                return;
            }

            // Do a check for the same input/output path
            if (FileSystem.InputPaths.Any(x => x.Equals(FileSystem.OutputPath)))
            {
                _logger.LogWarning("The output path is also one of the input paths which can cause unexpected behavior and is usually not advised");
            }

            CleanTempPath();

            // Clean the output folder if requested
            if (Settings.GetBool(Keys.CleanOutputPath))
            {
                CleanOutputPath();
            }

            // Create the pipeline phases
            if (_phases == null)
            {
                _phases = GetPipelinePhases(_pipelines, _logger);
            }

            // Start the timer
            Guid executionId = Guid.NewGuid();

            System.Diagnostics.Stopwatch engineStopwatch = System.Diagnostics.Stopwatch.StartNew();
            _logger.LogInformation($"Executing {_pipelines.Count} pipelines (execution ID {executionId})");

            // Setup (clear the document collection)
            Documents.Clear();

            // Get phase tasks
            Task[] phaseTasks = null;
            try
            {
                // Get and execute all phases
                phaseTasks = GetPhaseTasks(executionId, cancellationTokenSource);
                await Task.WhenAll(phaseTasks);
            }
            catch (Exception ex)
            {
                if (!(ex is OperationCanceledException))
                {
                    _logger.LogCritical("Error during execution");
                }
            }

            // Stop the timer
            engineStopwatch.Stop();
            _logger.LogInformation($"Finished execution in {engineStopwatch.ElapsedMilliseconds} ms");
        }
Пример #25
0
        /// <summary>
        /// Start processing file.
        /// </summary>
        public override void Parse()
        {
            _currentPosition = 0;
            Documents.Clear();
            LoadFileContents();

            while (_currentPosition < TotalLength)
            {
                // MESSAGE SIZE - not encoded
                var subArray = SubArray(FileContent, _currentPosition, MESSAGE_SIZE_LENGTH);
                Move(MESSAGE_SIZE_LENGTH);

                var hexRDW = GetHexString(subArray);

                var rdw = int.Parse(hexRDW, NumberStyles.HexNumber);

                if (rdw > 0)
                {
                    var message = CreateMessage(GetData(GetDataAndMove(MTI_LENGTH)), rdw);

                    byte[] bitmap;
                    var    bits = GetBitmapBits(out bitmap);
                    message.DataElements.Add(CreateDataElement(1, GetHexString(bitmap.Skip(8).Take(8).ToArray())));
                    _impParserConfig.DataElements.LoadPrimaryBitmap(bits);

                    foreach (var field in _impParserConfig.DataElements)
                    {
                        var fk = field.Key;
                        var fv = field.Value;
                        if (fv.Exists && fk > 1)
                        {
                            var dataElement = CreateDataElement(fk);

                            byte[] data   = { };
                            var    length = 0;

                            if (fv.DataLength.IsVariable)
                            {
                                var dataGet = GetData(GetDataAndMove(fv.DataLength.Length));
                                length = Convert.ToInt32(dataGet);
                                data   = GetDataAndMove(length);
                            }
                            else
                            {
                                length = fv.DataLength.Length;
                                data   = GetDataAndMove(length);
                            }

                            if (data != null && data.Length > 0)
                            {
                                dataElement.Value = GetData(data);

                                if (fv.Fields != null)
                                {
                                    GetSubFields(dataElement, fv.Fields, data);
                                }

                                if (fv.Elements != null)
                                {
                                    GetSubElements(dataElement, fv.Elements, data);
                                }

                                dataElement.Length = length;
                                message.DataElements.Add(dataElement);
                            }
                        }
                    }

                    Documents.Add(message);
                }
                else if (rdw == 0)
                {
                    _currentPosition = FileContent.Length;
                }
                else if (rdw < 0)
                {
                    var msg = $"MSG ({rdw} bytes). Error reading binary stream, message length is negative.";
                    var exc = new Exception(msg);
                    Log.LogError(exc, msg);

                    throw exc;
                }
            }
        }
 /// <summary>
 /// Method of the "Clear selected files" MenuItem, it drops every Document object of the ObservableCollection
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void mnuDropAllFile_Click(object sender, RoutedEventArgs e)
 {
     Documents.Clear();
     SetNumberDocument();
 }
Пример #27
0
        public MainWindowViewModel(ISessionService resultService, IMessenger messenger, ILayoutManager layoutManager, StatusViewModel statusViewModel)
        {
            StatusViewModel = statusViewModel;
            _sessionService = resultService;
            _layoutManager  = layoutManager;
            _messenger      = messenger;

            // TODO: These viewmodels should be injected
            LogPane               = ViewModelLocator.LogPanel;
            StatisticsPane        = ViewModelLocator.StatisticsPanel;
            RuntimeStatisticsPane = ViewModelLocator.RuntimeStatisticsPanel;
            ProfitLossPane        = ViewModelLocator.ProfitLossPanel;
            TradesPane            = ViewModelLocator.TradesPanel;

            ExitCommand        = new RelayCommand(() => Application.Current.Shutdown());
            CloseCommand       = new RelayCommand(() => _sessionService.ShutdownSession(), () => IsSessionActive);
            OpenSessionCommand = new RelayCommand(() => _messenger.Send(new ShowNewSessionWindowMessage()));
            ExportCommand      = new RelayCommand(Export, () => IsSessionActive);
            ConnectCommand     = new RelayCommand(() => _sessionService.IsSessionSubscribed = true, () => _sessionState != SessionState.Subscribed && _sessionService.CanSubscribe);
            DisconnectCommand  = new RelayCommand(() => _sessionService.IsSessionSubscribed = false, () => _sessionState != SessionState.Unsubscribed);

            SaveLayoutCommand    = new RelayCommand <DockingManager>(manager => _layoutManager.SaveLayout(manager));
            RestoreLayoutCommand = new RelayCommand <DockingManager>(manager => _layoutManager.LoadLayout(manager));
            ResetLayoutCommand   = new RelayCommand <DockingManager>(manager => _layoutManager.ResetLayout(manager));

            _messenger.Register <SessionOpenedMessage>(this, message => InvalidateCommands());

            _messenger.Register <SessionClosedMessage>(this, message =>
            {
                SessionState = SessionState.Unsubscribed;
                Documents.Clear();
                InvalidateCommands();
            });

            _messenger.Register <SessionStateChangedMessage>(this, message =>
            {
                SessionState = message.State;
                InvalidateCommands();
            });

            _messenger.Register <SessionUpdateMessage>(this, message =>
            {
                try
                {
                    lock (_documents)
                    {
                        ParseResult(message.ResultContext.Result);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            });

            _messenger.Register <GridRequestMessage>(this, message =>
            {
                var chartTableViewModel = new GridPanelViewModel
                {
                    Key = message.Key
                };

                // Calcualte the index for this tab
                var index = Documents.IndexOf(Documents.First(c => c.Key == message.Key));
                Documents.Insert(index, chartTableViewModel);

                chartTableViewModel.IsSelected = true;

                // Get the latest data for this tab and inject it
                var chart = _sessionService.LastResult.Charts[message.Key];
                chartTableViewModel.ParseChart(chart);
            });
        }
Пример #28
0
        public void RefreshSamples(bool canGetDatas = true)
        {
            if (shouldUpdate == false)
            {
                return;
            }

            if (SysProcessManager == null)
            {
                return;
            }
            if (!mudoleHasInit)
            {
                return;
            }
            OnPropertyChanged("AllETLMount");

            var tasks = SysProcessManager.CurrentProcessTasks.Where(d => d.Publisher == this).ToList();

            if (tasks.Any())
            {
                var str = $"{Name}已经有任务在执行,由于调整参数,是否要取消当前任务重新执行?\n 【取消】:【不再提醒】";
                if (isErrorRemind == false)
                {
                    XLogSys.Print.Warn($"{Name}已经有任务在执行,请在任务管理器中取消该任务后再刷新");
                    return;
                }
                if (!MainDescription.IsUIForm)
                {
                    return;
                }
                var result =
                    MessageBox.Show(str, "提示信息", MessageBoxButton.YesNoCancel);
                if (result == MessageBoxResult.Yes)
                {
                    foreach (var item in tasks)
                    {
                        item.Remove();
                    }
                    XLogSys.Print.Warn(str + "  已经取消");
                }
                else if (result == MessageBoxResult.Cancel)
                {
                    isErrorRemind = false;
                }
                else
                {
                    return;
                }
            }
            if (dataView == null && MainDescription.IsUIForm && IsUISupport)
            {
                var dock    = MainFrm as IDockableManager ?? ControlExtended.DockableManager;
                var control = dock?.ViewDictionary.FirstOrDefault(d => d.Model == this);
                if (control != null)
                {
                    if (control.View is IRemoteInvoke)
                    {
                        var invoke = control.View as IRemoteInvoke;
                        invoke.RemoteFunc = DropAction;
                    }
                    dynamic dy = control.View;

                    dataView     = dy.DataList;
                    scrollViewer = dy.ScrollViewer;

                    alltoolList     = dy.ETLToolList;
                    currentToolList = dy.CurrentETLToolList;
                    currentToolList.MouseDoubleClick += (s, e) =>
                    {
                        if (e.ChangedButton != MouseButton.Left)
                        {
                            return;
                        }
                        var process = currentToolList.SelectedItem as IColumnProcess;
                        if (process == null)
                        {
                            return;
                        }
                        var oldProp = process.UnsafeDictSerializePlus();
                        var window  = PropertyGridFactory.GetPropertyWindow(process);
                        window.Closed += (s2, e2) =>
                        {
                            if (
                                (oldProp.IsEqual(process.UnsafeDictSerializePlus()) == false && IsAutoRefresh).SafeCheck
                                    ("检查模块参数是否修改", LogType.Debug))
                            {
                                RefreshSamples();
                            }
                        };
                        window.ShowDialog();
                    };
                    dragMgr = new ListViewDragDropManager <IColumnProcess>(currentToolList);
                    dragMgr.ShowDragAdorner = true;

                    alltoolList.MouseMove += (s, e) =>
                    {
                        if (e.LeftButton == MouseButtonState.Pressed)
                        {
                            var attr = alltoolList.SelectedItem as XFrmWorkAttribute;
                            if (attr == null)
                            {
                                return;
                            }

                            var data = new DataObject(typeof(XFrmWorkAttribute), attr);
                            try
                            {
                                DragDrop.DoDragDrop(control.View as UserControl, data, DragDropEffects.Move);
                            }
                            catch (Exception ex)
                            {
                            }
                        }
                    };
                }
            }
            if (dataView == null)
            {
                return;
            }
            Analyzer.Items.Clear();

            var alltools = CurrentETLTools.Take(ETLMount).ToList();
            var func     = alltools.Aggregate(isexecute: false, analyzer: Analyzer);

            if (!canGetDatas)
            {
                return;
            }
            SmartGroupCollection.Clear();
            Documents.Clear();
            shouldUpdate = false;
            var i = 0;

            foreach (var currentEtlTool in CurrentETLTools)
            {
                (currentEtlTool).ETLIndex = i++;
            }
            shouldUpdate = true;
            if (!MainDescription.IsUIForm)
            {
                return;
            }
            all_columns.Clear();
            dataView.Columns.Clear();

            AddColumn("", alltools);
            var temptask = TemporaryTask.AddTempTask(Name + "_转换",
                                                     func(new List <IFreeDocument>()).Take(SampleMount),
                                                     data =>
            {
                ControlExtended.UIInvoke(() =>
                {
                    foreach (var key in data.GetKeys().Where(d => all_columns.Contains(d) == false).OrderBy(d => d))
                    {
                        AddColumn(key, alltools);
                        DeleteColumn("");
                        all_columns.Add(key);
                    }

                    Documents.Add((data));
                    InitUI();
                });
            }, r =>
            {
                var tool      = CurrentTool;
                var outputCol = new List <string>();
                var inputCol  = new List <string>();

                if (tool != null)
                {
                    inputCol.Add(tool.Column);

                    var transformer = tool as IColumnDataTransformer;
                    if (transformer != null)
                    {
                        if (transformer is CrawlerTF)
                        {
                            var crawler = transformer as CrawlerTF;
                            outputCol   = crawler?.Crawler?.CrawlItems.Select(d => d.Name).ToList();
                        }
                        else if (transformer is ETLBase)
                        {
                            var etl    = transformer as ETLBase;
                            var target = etl.GetModule <SmartETLTool>(etl.ETLSelector.SelectItem);
                            outputCol  = target?.Documents.GetKeys().ToList();
                            inputCol.AddRange(etl.MappingSet.Split(' ').Select(d => d.Split(':')[0]));
                        }
                        else
                        {
                            outputCol = transformer.NewColumn.Split(' ').ToList();
                        }
                        SmartGroupCollection.Where(d => outputCol != null && outputCol.Contains(d.Name))
                        .Execute(d => d.GroupType = GroupType.Output);
                        SmartGroupCollection.Where(d => inputCol.Contains(d.Name))
                        .Execute(d => d.GroupType = GroupType.Input);
                    }
                }

                var firstOutCol = outputCol?.FirstOrDefault();
                if (firstOutCol != null)
                {
                    var index = all_columns.IndexOf(firstOutCol);
                    if (index != -1 && ETLMount < AllETLMount)
                    {
                        scrollViewer.ScrollToHorizontalOffset(index * CellWidth);
                    }
                }
                var nullgroup = SmartGroupCollection.FirstOrDefault(d => string.IsNullOrEmpty(d.Name));
                nullgroup?.Value.AddRange(
                    alltools.Where(
                        d =>
                        Documents.GetKeys().Contains(d.Column) == false &&
                        string.IsNullOrEmpty(d.Column) == false));
                nullgroup?.OnPropertyChanged("Value");
            }
                                                     , SampleMount);

            temptask.Publisher  = this;
            temptask.IsSelected = true;
            SysProcessManager.CurrentProcessTasks.Add(temptask);
        }