Exemplo n.º 1
0
 private void ClearPropertyFromList(ActSoapUiInputValue.ePropertyType propertyType)
 {
     if (mAct.AllProperties.Any(x => x.Type.ToString() == propertyType.ToString()))
     {
         foreach (var item in mAct.AllProperties)
         {
             if (mAct.TempProperties.Count() > 0)
             {
                 var result = mAct.TempProperties.Where(x => x.Type.ToString() == item.Type.ToString() && x.Param == item.Param && x.Value == item.Value).FirstOrDefault();
                 if (result == null)
                 {
                     var clearItem = mAct.TempProperties.Where(x => x.Type.ToString() == item.Type.ToString() && x.Param == item.Param).FirstOrDefault();
                     mAct.TempProperties.Remove(clearItem);
                     mAct.TempProperties.Add(item);
                 }
             }
             else
             {
                 mAct.TempProperties.Add(item);
             }
         }
         mAct.AllProperties.Where(l => l.Type == propertyType.ToString()).ToList().All(i => mAct.AllProperties.Remove(i));
     }
 }
Exemplo n.º 2
0
        private void PopulatePropertiesGrid(XmlNodeList properties, ActSoapUiInputValue.ePropertyType propertiesType)
        {
            foreach (XmlNode property in properties)
            {
                ActSoapUiInputValue testProperty = new ActSoapUiInputValue();
                XmlNodeList         propertyTags = property.ChildNodes;
                foreach (XmlNode tag in propertyTags)
                {
                    if (tag.Name == "con:name")
                    {
                        testProperty.Param = tag.InnerText;
                    }
                    if (tag.Name == "con:value")
                    {
                        testProperty.Value = tag.InnerText;
                    }
                }
                //update Property type Field
                testProperty.Type = propertiesType.ToString();

                if (mAct.TempProperties.Count > 0)
                {
                    var savedProperty = mAct.TempProperties.Where(x => x.Param == testProperty.Param && x.Type == testProperty.Type.ToString()).FirstOrDefault();
                    if (savedProperty != null)
                    {
                        var savedPropertyValue = savedProperty.Value;
                        if (!string.IsNullOrEmpty(savedPropertyValue))
                        {
                            testProperty.Value = savedPropertyValue;
                        }
                    }
                }

                mAct.AllProperties.Add(testProperty);
            }
        }