/// <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>NA</param> public void GoToNext() { this.currentStepInfo.SetStatus(StepStatus.success); StepInfo temp = this.currentStepInfo; this.currentStepInfo = this.Next(); }
/// <summary> /// /// </summary> /// <remarks></remarks> /// <seealso cref=""/> /// <param name="index"></param> public void SetCurrent(int index) { currentStepInfo = StepInfos.ElementAt(index); currentStepInfo.SetStatus(StepStatus.inProgress); for (int i = index + 1; i < StepInfos.Count(); i++) { StepInfos.ElementAt(i).SetStatus(StepStatus.none); } }
public bool IsEquals(StepInfo stepInfo) { if (this.Id.Equals(stepInfo.Id)) { return(true); } else { return(false); } }
/// <summary> /// /// </summary> /// <remarks></remarks> /// <seealso cref=""/> /// <param name="stepinfo"></param> public void RemoveExecutedStep(StepInfo stepinfo) { if (TaskInfos == null) { TaskInfos = new List <StepInfo>(); } else { if (TaskInfos.Contains(stepinfo)) { TaskInfos.Remove(stepinfo); } prevStepInfo = TaskInfos.Last(); } }
/// <summary> /// /// </summary> /// <remarks></remarks> /// <seealso cref=""/> /// <param name="stepinfo"></param> public void AddExecutedStep(StepInfo stepinfo) { prevStepInfo = stepinfo; if (TaskInfos == null) { TaskInfos = new List <StepInfo>(); } if (TaskInfos.Count > 0) { if (TaskInfos.Select(p => p.title.Equals(stepinfo.title)).First()) { StepInfo tempStep = TaskInfos.Where(p => p.title.Equals(stepinfo.title)).First(); TaskInfos.Remove(tempStep); } } TaskInfos.Add(stepinfo); }
/// <summary> /// /// </summary> /// <remarks></remarks> /// <seealso cref=""/> /// <param name="stepInfo"></param> public void SetCurrent(StepInfo stepInfo) { currentStepInfo = stepInfo; currentStepInfo.SetStatus(StepStatus.inProgress); }
/// <summary> /// /// </summary> /// <remarks></remarks> /// <seealso cref=""/> /// <param name="stepInfo"></param> /// <returns></returns> public int GetIndex(StepInfo stepInfo) { return(this.StepInfos.IndexOf(stepInfo)); }
/// <summary> /// /// </summary> /// <remarks></remarks> /// <seealso cref=""/> /// <param>NA</param> public void GoToPrev() { StepInfo temp = this.currentStepInfo; this.currentStepInfo = this.Prev(); }