// TODO: character recognition needs to change with unicode support.
 public Results CheckFile(string filename)
 {
     Results results = new Results(filename);
     try {
         using (FileStream file = File.Open(filename, FileMode.Open)) {
             HeightRule lineChecker = new HeightRule(filename);
             WidthRule widthChecker = new WidthRule();
             while (file.Position < file.Length) {
                 char currentCharacter = (char)file.ReadByte();
                 lineChecker.Check(currentCharacter);
                 widthChecker.Check(currentCharacter);
             }
             lineChecker.ReportViolations(results);
             widthChecker.ReportViolations(results);
         }
     } catch (FileNotFoundException fne) {
         results.Add(Violation.FileNotFoundViolation(fne, filename));
     }
     return results;
 }
 public void ReportViolations(Results toResults)
 {
     foreach (Violation violation in violations) {
         toResults.Add(violation);
     }
 }
 public Results CheckFile(string fileName)
 {
     Results results;
     try {
         using (Stream file = File.Open(fileName, FileMode.Open)) {
             results = Check(file, fileName);
         }
     } catch (FileNotFoundException exception) {
         results = new Results(fileName);
         Violation violation = new Violation(ViolationType.FileNotFound, exception.Message, Constants.NO_LINE, fileName);
         results.Add(violation);
     }
     return results;
 }
 public virtual void ReportViolations(Results toResults)
 {
     DoNewLine();
     foreach (Violation violation in violations) {
         toResults.Add(violation);
     }
 }
 public override void ReportViolations(Results toResults)
 {
     if (Constants.ALLOWABLE_LINES_PER_FILE < myCodeLenght) {
         toResults.Add(CompilationUnitTooLong());
     }
 }
        public Results CheckFile(string filename)
        {
            List<Rule> rules = GetRules(filename);

            Results results = new Results(filename);
            try {
                using (FileStream file = File.Open(filename, FileMode.Open)) {
                    while (file.Position < file.Length) {
                        char currentCharacter = (char)file.ReadByte();
                        foreach (Rule rule in rules) {
                            rule.Check(currentCharacter);
                        }
                    }
                    foreach (Rule rule in rules) {
                        rule.ReportViolations(results);
                    }
                }
            } catch (FileNotFoundException fne) {
                results.Add(FileNotFoundViolation(fne, filename));
            }
            return results;
        }
 public override void ReportViolations(Results toResults)
 {
     if (myLines > 700) {
         toResults.Add(Violation.CompilationUnitTooLong(fileName, myLines));
     }
 }
 public override void ReportViolations(Results toResults)
 {
     NewLine();
     foreach (Violation violation in violations) {
         toResults.Add(violation);
     }
 }