Exemplo n.º 1
0
        public void saveData(MTBTaskConditionData conditionData)
        {
            XmlDocument data = new XmlDocument();

            data.LoadXml(Resources.Load(CONDITIONDATA_PATH).ToString());
            XmlNode    root    = data.SelectSingleNode("TaskCondition");
            XmlElement element = conditionData.save(data);

            root.AppendChild(element);
            data.Save(Application.dataPath + "/Resources/" + CONDITIONDATA_PATH + ".xml");
        }
Exemplo n.º 2
0
        public void loadData()
        {
            TASKDATALIST.Clear();
            XmlDocument conditionData = new XmlDocument();

            conditionData.LoadXml(Resources.Load(CONDITIONDATA_PATH).ToString());
            XmlNodeList nodeList = conditionData.GetElementsByTagName("TaskCondition")[0].ChildNodes;

            foreach (XmlElement xe in nodeList)
            {
                MTBTaskConditionData data = new MTBTaskConditionData();
                data.decode(xe);
                TASKDATALIST.Add(xe.GetAttribute("id"), data);
            }
        }
Exemplo n.º 3
0
        public PlotStepCondition(MTBTaskData taskData, MTBTaskStepData stepData)
        {
            MTBTaskConditionData data = MTBTaskConditionManager.Instance.getData(stepData.condtion);

            startTriggerCondition        = TaskConditionFactory.GetStartTriggerCondition(data.startTriggerCondition.scriptName);
            startTriggerCondition.taskId = taskData.id;
            startTriggerCondition.stepId = stepData.id;
            startTriggerCondition.setParams(data.startTriggerCondition.paras);

            finishTriggerCondition        = TaskConditionFactory.GetFinishTriggerCondition(data.finishTriggerCondition.scriptName);
            finishTriggerCondition.taskId = taskData.id;
            finishTriggerCondition.stepId = stepData.id;
            finishTriggerCondition.setParams(data.finishTriggerCondition.paras);

            finishCondition        = TaskConditionFactory.GetFinishCondition(data.finishCondition.scriptName);
            finishCondition.taskId = taskData.id;
            finishCondition.stepId = stepData.id;
            finishCondition.setParams(data.finishCondition.paras);

            tipStr = data.tipsCondition.content;
        }