public MultiTask CreateMultiTask() { List <string> m_DatasourceList = null; List <enumDataType> m_DatasourceTypes = null; List <string> m_TaskNameList = null; TestDatasourceFolder(ref m_DatasourceList, ref m_DatasourceTypes, ref m_TaskNameList); MultiTask multiTask = new MultiTask(); int count = m_DatasourceList.Count; for (int i = 0; i < count; i++) { ExtendTask task = new ExtendTask(); task.SourcePath = m_DatasourceList[i]; string strTaskName = TaskHelper.GetValidateTaskName(this.DatasourceFolder, m_TaskNameList[i]); task.Path = this.DatasourceFolder; task.Name = strTaskName; task.TopoTolerance = this.TopoTolerance; task.MapScale = this.MapScale; task.DatasourceType = m_DatasourceTypes[i]; task.UseSourceDirectly = false; task.SchemaID = this.SchemaID; task.CheckMode = enumCheckMode.CreateOnly; multiTask.AddTask(task); } return(multiTask); }
public MultiTask CreateMultiTask() { List<string> m_DatasourceList = null; List<enumDataType> m_DatasourceTypes = null; List<string> m_TaskNameList = null; TestDatasourceFolder(ref m_DatasourceList, ref m_DatasourceTypes, ref m_TaskNameList); MultiTask multiTask = new MultiTask(); int count = m_DatasourceList.Count; for (int i = 0; i < count; i++) { ExtendTask task = new ExtendTask(); task.SourcePath = m_DatasourceList[i]; string strTaskName = TaskHelper.GetValidateTaskName(this.DatasourceFolder, m_TaskNameList[i]); task.Path= this.DatasourceFolder; task.Name = strTaskName; task.TopoTolerance= this.TopoTolerance; task.MapScale= this.MapScale; task.DatasourceType= m_DatasourceTypes[i]; task.UseSourceDirectly= false; task.SchemaID = this.SchemaID; task.CheckMode = enumCheckMode.CreateOnly; multiTask.AddTask(task); } return multiTask; }
private void wizardControl1_FinishClick(object sender, CancelEventArgs e) { DataTable tTasks = GridCheckSetting.DataSource as DataTable; if (tTasks.Rows.Count > 0) { this.Hide(); MultiTask multiTask = new MultiTask(); for (int i = 0; i < tTasks.Rows.Count; i++) { multiTask.AddTask(this.GetTaskFromDataRow(tTasks.Rows[i])); } //FrmMultiTaskCheck frmCheck = new FrmMultiTaskCheck(multiTask); //frmCheck.ExcuteMultiTask(ref m_AvailableTasks); multiTask.CreatingTaskChanged += new TaskCreateEventsHandler(multiTask_CreatingTaskChanged); multiTask.TaskCreated += new TaskCreateEventsHandler(multiTask_TaskCreated); multiTask.CheckingTaskChanged += new TaskCheckEventsHandler(multiTask_CheckingTaskChanged); multiTask.TaskChecked += new TaskCheckEventsHandler(multiTask_TaskChecked); //m_FrmCheck.AdaptCheckerEvents(multiTask.TaskChecker); //System.Threading.ThreadStart threadStart = delegate //{ bool isSucceed = multiTask.Excute(ref m_AvailableTasks); if (isSucceed) { XtraMessageBox.Show(multiTask.PromptMessage); } else { XtraMessageBox.Show("批量任务过程中出现错误,创建失败"); } //}; //System.Threading.Thread thread = new System.Threading.Thread(threadStart); //thread.Start(); } }