Ejemplo n.º 1
0
        /// <summary>
        /// 获得当前step的可编辑属性
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>

        private List <EditStepPB> StepParamBinding()
        {
            var StepXml = testCaseHelper.autoStepParam(name, this.FID, this.PID);



            //合并属性
            List <EditStepPB> pbs = new List <EditStepPB>();

            if (StepXml == null)
            {
                return(pbs);
            }

            foreach (var pbx in StepXml.Descendants("ParamBinding"))
            {
                EditStepPB pb = new EditStepPB();
                pb.name = pbx.Attribute("name").Value;
                if (pbx.Attribute("value") != null)
                {
                    pb.value = pbx.Attribute("value").Value;
                }

                if (pbx.Attribute("desc") == null)
                {
                    pb.desc = pb.name;
                }
                else
                {
                    pb.desc = pbx.Attribute("desc").Value;
                }

                if (pbx.Attribute("list") != null)
                {
                    pb.data = list2data(pbx.Attribute("list").Value);
                }
                else if (pb.name == "applicationID")  //打开应用的ID,修改?
                {
                    var apps = from t in userHelper.getApps()
                               select new
                    {
                        label = t.name,
                        value = t.ID
                    };


                    pb.data = JsonConvert.SerializeObject(apps);
                }

                pbs.Add(pb);
            }

            return(pbs);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得当前step的可编辑属性
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>

        private List <EditStepPB> StepParamBinding()
        {
            var StepXml = testCaseHelper.autoStepParam(name, this.FID, this.PID);



            //合并属性
            List <EditStepPB> pbs = new List <EditStepPB>();

            if (StepXml == null)
            {
                return(pbs);
            }

            foreach (var pbx in StepXml.Descendants("ParamBinding"))
            {
                EditStepPB pb = new EditStepPB();
                pb.name = pbx.Attribute("name").Value;
                if (pbx.Attribute("value") != null)
                {
                    pb.value = pbx.Attribute("value").Value;
                }

                if (pbx.Attribute("desc") == null)
                {
                    pb.desc = pb.name;
                }
                else
                {
                    pb.desc = pb.name + " : " + pbx.Attribute("desc").Value;
                }

                if (pbx.Attribute("list") != null)
                {
                    pb.data = list2data(pbx.Attribute("list").Value);
                }

                pbs.Add(pb);
            }

            return(pbs);
        }