private static void Add(List <DependencyRule> ruleList, DependencyRule rule) { if (!ruleList.Any(r => r.IsSameAs(rule))) { ruleList.Add(rule); } }
private static IEnumerable <DependencyRule> CreateDependencyRules(DependencyRuleSet parent, string ruleFileName, uint lineNo, string line, string sep, bool questionableRule) { DependencyRuleRepresentation rep = new DependencyRuleRepresentation(ruleFileName, lineNo, line, questionableRule); int i = line.IndexOf(sep); string usingPattern = parent.ExpandDefines(line.Substring(0, i).Trim()); string usedPattern = parent.ExpandDefines(line.Substring(i + sep.Length).Trim()); List <DependencyRule> deps = DependencyRule.CreateDependencyRules(usingPattern, usedPattern, rep); if (Log.IsVerboseEnabled) { Log.WriteInfo(String.Format("Rules used for checking {0} ({1}:{2})", line, ruleFileName, lineNo)); foreach (DependencyRule d in deps) { Log.WriteInfo(" " + d); } } return(deps); }
public bool IsSameAs(DependencyRule rule) { return _ruleMatch.Equals(rule._ruleMatch); }
private static void Add(List<DependencyRule> ruleList, DependencyRule rule) { if (!ruleList.Any(r => r.IsSameAs(rule))) { ruleList.Add(rule); } }
public bool IsSameAs(DependencyRule rule) { return(_ruleMatch.Equals(rule._ruleMatch)); }