/// <summary> /// /// </summary> /// <remarks></remarks> /// <seealso cref=""/> /// <param name="xmlDocument"></param> /// <returns></returns> public static AbstractTaskManager Bind(XmlDocument xmlDocument) { XmlNodeList xmlStepInfos = xmlDocument.GetElementsByTagName("stepInfo"); AbstractTaskManager tm = new AbstractTaskManager(); tm.StepInfos = new List<StepInfo>(); foreach (XmlNode xmlStepInfo in xmlStepInfos) { StepInfo si = new StepInfo(xmlStepInfo.Attributes.GetNamedItem("title").Value) { GetActionInfo = new ActionInfo { ActionName = xmlStepInfo.Attributes.GetNamedItem("action").Value, ControllerName = xmlStepInfo.Attributes.GetNamedItem("controller").Value, AreaName = xmlStepInfo.Attributes.GetNamedItem("area").Value }, PostActionInfo = new ActionInfo { ActionName = xmlStepInfo.Attributes.GetNamedItem("action").Value, ControllerName = xmlStepInfo.Attributes.GetNamedItem("controller").Value, AreaName = xmlStepInfo.Attributes.GetNamedItem("area").Value } }; tm.StepInfos.Add(si); } tm.currentStepInfo = tm.StepInfos.First(); return tm; }
/// <summary> /// /// </summary> /// <remarks></remarks> /// <seealso cref=""/> /// <param name="xmlDocument"></param> /// <returns></returns> public static AbstractTaskManager Bind(XmlDocument xmlDocument) { XmlNodeList xmlStepInfos = xmlDocument.GetElementsByTagName("stepInfo"); AbstractTaskManager tm = new AbstractTaskManager(); tm.StepInfos = new List <StepInfo>(); foreach (XmlNode xmlStepInfo in xmlStepInfos) { StepInfo si = new StepInfo(xmlStepInfo.Attributes.GetNamedItem("title").Value) { GetActionInfo = new ActionInfo { ActionName = xmlStepInfo.Attributes.GetNamedItem("action").Value, ControllerName = xmlStepInfo.Attributes.GetNamedItem("controller").Value, AreaName = xmlStepInfo.Attributes.GetNamedItem("area").Value }, PostActionInfo = new ActionInfo { ActionName = xmlStepInfo.Attributes.GetNamedItem("action").Value, ControllerName = xmlStepInfo.Attributes.GetNamedItem("controller").Value, AreaName = xmlStepInfo.Attributes.GetNamedItem("area").Value } }; tm.StepInfos.Add(si); } tm.currentStepInfo = tm.StepInfos.First(); return(tm); }