private List <StepDef> ParseStepDef(string fileName) { var xml = XElement.Load(fileName); var items = xml.Descendants(ItemName); return(items.Select(n => StepDef.Load(n, _valueStore)).ToList()); }
public static StepDef Load(XElement node, ValueStore valueStore) { var re = node.Descendants(ReNodeName).FirstOrDefault(); if (re == null) { return(null); } var reStr = GetRexpFromReNode(re.Value); if (string.IsNullOrEmpty(re.Value)) { return(null); } var sd = new StepDef(reStr); UInt16 i = 0; var sdParams = node.Descendants(ParamNodeName) .Select(n => StepDefParameter.Load(i++, n, valueStore)) .ToList(); sd.Params.AddRange(sdParams); return(sd); }
public void AddStepDef(Regex regex) { var stepDef = new StepDef(regex, _valueStore); _stepDefs.Add(stepDef); }