// 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; }