private void CreateTaskAndScheduler(WidgetFactory factory, int channel, int n) { var render = factory.CreatePointRender(); _listPool = new ListRenderItemPool(); _listRenderTask = factory.CreateListRenderTask(this.Dispatcher, render, _listPool); _viewPool = new ViewRenderItemPool(render, this.Dispatcher); _viewRenderTask = factory.CreateViewRenderTask(this.Dispatcher, render, _viewPool); _statisticTask = factory.CreateStatisticTask(OnExceedLimit); _scrollTask = factory.CreateScrollTask(WaveListBox.OwnedScrollViewer); _scheduler = new WaveTaskScheduler( factory.CreateBaseDataSource(channel, n), factory.CreateRealDataCollector(channel, n), factory.CreateRealDataFile(), _listRenderTask, _viewRenderTask, _statisticTask, _scrollTask, OnRenderingStarted, OnRenderingStoped ); }
public ITask Create(IAction action) { ITask task = null; if (taskDic.TryGetValue(action.ActionType, out task)) { return(task); } if (action.ActionType == ActionType.PageAction) { task = new PageTask(manager); } else if (action.ActionType == ActionType.BrowserAction) { task = new BrowserTask(manager); } else if (action.ActionType == ActionType.FindAction) { task = new FindTask(manager); } else if (action.ActionType == ActionType.MouseAction) { task = new MouseTask(manager); } else if (action.ActionType == ActionType.AttributeAction) { task = new AttributeTask(manager); } else if (action.ActionType == ActionType.ScrollAction) { task = new ScrollTask(manager); } else if (action.ActionType == ActionType.ClearDataAction) { task = new ClearDataTask(manager); } else if (action.ActionType == ActionType.WaitAction) { task = new WaitTask(manager); } else if (action.ActionType == ActionType.ClickAction) { task = new ClickTask(manager); } else if (action.ActionType == ActionType.KeyboardAction) { task = new KeyboardTask(manager); } else if (action.ActionType == ActionType.SendKeyAction) { task = new SendKeyTask(manager); } else if (action.ActionType == ActionType.ConditionAction) { task = new ConditionTask(manager); } else if (action.ActionType == ActionType.ClearHistoryAction) { task = new ClearHistoryTask(manager); } else if (action.ActionType == ActionType.TextAction) { task = new TextTask(manager); } else if (action.ActionType == ActionType.ScriptAction) { task = new ScriptTask(manager); } else if (action.ActionType == ActionType.PackageAction) { task = new PackageTask(manager); } taskDic.Add(action.ActionType, task); return(task); }