示例#1
0
        public void InitByTaskType(string typeName)
        {
            taskTypeData = TaskTypeMgr.Ins.GetTaskTypeData_ByTypeName(typeName);

            if (typeName != curTaskData.strTaskTypeName)
            {
                //换了类型,需要重新初始化
                ST_TaskArgumentData[] arrTmp = null;
                if (taskTypeData.arrArgument != null)
                {
                    arrTmp = new ST_TaskArgumentData[taskTypeData.arrArgument.Length];
                    for (int i = 0; i < taskTypeData.arrArgument.Length; i++)
                    {
                        arrTmp[i] = new ST_TaskArgumentData()
                        {
                            strTag          = taskTypeData.arrArgument[i].strArgumentName,
                            eM_ArgumentType = taskTypeData.arrArgument[i].eM_ArgumentType,
                            nArgumentNum    = taskTypeData.arrArgument[i].nNum,
                            listMember      = new List <string>(),
                        };
                    }
                }

                _curTaskData = new ST_TaskData()
                {
                    strID           = _curTaskData.strID,
                    strTaskTypeName = typeName,
                    arrArgumentData = arrTmp
                };
            }

            view?.OnValueReset(curTaskData);
        }
示例#2
0
        public TaskEditor AddTask(ST_TaskData data)
        {
            TaskEditor editor = new TaskEditor(data, CreatTaskEditroView());

            listTaskEditor.Add(editor);
            return(editor);
        }
示例#3
0
        public TaskEditor(ST_TaskData taskData, ITaskEditorView taskEditorView)
        {
            this.view = taskEditorView;
            view?.Init(this);

            this._curTaskData = taskData;
            InitByTaskType(taskData.strTaskTypeName);
        }