protected override IEnumerable <T> Gets() { if (this.classes != null) { foreach (var checkClass in this.classes) { yield return(checkClass); } } else { var foundClass = false; foreach (var checkType in this.GetTypes()) { if (FileUtil.FilenameMatchesPattern(checkType.Name, this.Pattern)) { foundClass = true; yield return(checkType); } } if (!foundClass) { throw new MatchException("No class found that match '{0}'.", this.Pattern); } } }
protected override IEnumerable <IMethod> Gets() { foreach (var method in this.methods) { if (this.pattern == null || FileUtil.FilenameMatchesPattern(method.Name, this.pattern)) { yield return(method); } } }
public override IEnumerable <IMethod> Method(string name) { foreach (var method in this.compilationInfo.Get <IMethod>()) { if (FileUtil.FilenameMatchesPattern(method.Name, name)) { if (method.Type == this) { yield return(method); } } } }
private IEnumerable <CheckFile> Gets(ICompilationInfo compilationInfo) { return(from document in compilationInfo.Project.Documents where FileUtil.FilenameMatchesPattern(document.Name, this.pattern) select new CheckFile(document, compilationInfo)); }
private CheckTypes(IEnumerable <T> classes, string pattern, string typeName) : this(classes.Where(c => FileUtil.FilenameMatchesPattern(c.Name, pattern)), typeName) { }
public CheckAssemblies(IEnumerable <IAssembly> checkAssemblies, string matchAssemblies) { this.checkAssemblies = checkAssemblies.Where(a => FileUtil.FilenameMatchesPattern(a.FileName, matchAssemblies)); this.matchAssemblies = matchAssemblies; }
public CheckReferences(ICompilationInfo compilationInfo, string pattern) { this.checkReferences = compilationInfo.Project.References.Where(r => FileUtil.FilenameMatchesPattern(r.Name, pattern)) .Select(r => new CheckReference(r.Name)); }