예제 #1
0
파일: CheckTypes.cs 프로젝트: swoog/CheckIt
        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);
                }
            }
        }
예제 #2
0
 protected override IEnumerable <IMethod> Gets()
 {
     foreach (var method in this.methods)
     {
         if (this.pattern == null || FileUtil.FilenameMatchesPattern(method.Name, this.pattern))
         {
             yield return(method);
         }
     }
 }
예제 #3
0
 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);
             }
         }
     }
 }
예제 #4
0
파일: Files.cs 프로젝트: swoog/CheckIt
 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));
 }
예제 #5
0
파일: CheckTypes.cs 프로젝트: swoog/CheckIt
 private CheckTypes(IEnumerable <T> classes, string pattern, string typeName)
     : this(classes.Where(c => FileUtil.FilenameMatchesPattern(c.Name, pattern)), typeName)
 {
 }
예제 #6
0
 public CheckAssemblies(IEnumerable <IAssembly> checkAssemblies, string matchAssemblies)
 {
     this.checkAssemblies = checkAssemblies.Where(a => FileUtil.FilenameMatchesPattern(a.FileName, matchAssemblies));
     this.matchAssemblies = matchAssemblies;
 }
예제 #7
0
 public CheckReferences(ICompilationInfo compilationInfo, string pattern)
 {
     this.checkReferences =
         compilationInfo.Project.References.Where(r => FileUtil.FilenameMatchesPattern(r.Name, pattern))
         .Select(r => new CheckReference(r.Name));
 }