public Keyword(CriterionStep step, IXmlRpcClient proxy, BehaviorConfiguration config) { Name = step.Name; Config = config; Proxy = proxy; Parameters = new Dictionary<string, object>(); var argCount = 0; foreach (object p in step.Parameters) { if (p.GetType().Equals(typeof(string))) Parameters.Add("arg" + argCount, p as string); else Parameters.Add("arg" + argCount, p); argCount++; } if (!int.TryParse(Config.GuiDelay, out guiDelay)) guiDelay = 0; if (guiDelay < 0) guiDelay = 0; KeywordExists = ValidateKeywordName(Name); if(KeywordExists) ParametersAreCorrect = ValidateParameters(Name, Parameters); }
public Criterion BuildCriterion(ref List<Criterion> beforeCriteria) { var criterion = new Criterion(this); criterion.BeforeCriteria.AddRange(beforeCriteria); beforeCriteria.Clear(); var currentLine = 0; if (Lines.Count > 0) { var matches = LanguageElements.Keywords.Any(t => FirstWord(currentLine).StartsWith(t)); while (MatchesKeyword(Lines[currentLine]) && currentLine < Lines.Count) { var step = new CriterionStep(Lines[currentLine]); if (currentLine < Lines.Count - 1) { currentLine++; if (Lines[currentLine].StartsWith(LanguageElements.TableDelimiter)) step.Table = new Table().Parse(Lines, ref currentLine); } else { criterion.Steps.Add(step); break; } criterion.Steps.Add(step); } } return criterion; }