Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        /// <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();
        }
Esempio n. 3
0
        /// <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);
            }
        }
Esempio n. 4
0
 public bool IsEquals(StepInfo stepInfo)
 {
     if (this.Id.Equals(stepInfo.Id))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 5
0
        /// <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();
            }
        }
Esempio n. 6
0
        /// <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);
        }
Esempio n. 7
0
 /// <summary>
 ///
 /// </summary>
 /// <remarks></remarks>
 /// <seealso cref=""/>
 /// <param name="stepInfo"></param>
 public void SetCurrent(StepInfo stepInfo)
 {
     currentStepInfo = stepInfo;
     currentStepInfo.SetStatus(StepStatus.inProgress);
 }
Esempio n. 8
0
 /// <summary>
 ///
 /// </summary>
 /// <remarks></remarks>
 /// <seealso cref=""/>
 /// <param name="stepInfo"></param>
 /// <returns></returns>
 public int GetIndex(StepInfo stepInfo)
 {
     return(this.StepInfos.IndexOf(stepInfo));
 }
Esempio n. 9
0
        /// <summary>
        ///
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref=""/>
        /// <param>NA</param>
        public void GoToPrev()
        {
            StepInfo temp = this.currentStepInfo;

            this.currentStepInfo = this.Prev();
        }