public Results CheckFile(string filename)
 {
     // Line does not end in ";", "{", "," or "}"
     Results results =
         new Results(filename);
     return results;
 }
 public Results CheckFile(string filename, object blam)
 {
     // This comment shouldn't count against the limit of 20 lines
     Results results = new Results(filename);
     /*
      * Neither do this
      */
     if (true) { // nor this
         if (true) {
             if (true) {
                 if (true) {
                     if (true) {
                         if (true) {
                             if (true) {
                                 Console.Out.Write("I am going to say...");
                                 Console.Out.Write("WHOPEEE!!!");
                             }
                         }
                     }
                 }
             }
         }
     }
     return results;
 }
 public Results CheckFile(string filename, object blam)
 {
     Results results = new Results(filename);
     return results;
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("poop!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("poop!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("poop!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("poop!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("poop!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("poop!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("hurr!");
     Console.Out.WriteLine("poop!");
 }
 public Results CheckFile(string filename)
 {
     Results results = new Results(filename);
     // parens are in string comments
     string theScc = "for (int i = 0"; string sucks = "i < 2; i++)";
     Console.Out.WriteLine("hello!");
     return results;
 }
 public Results CheckFile(string filename)
 {
     Results results = new Results(filename);
     // this will be ok, since the ";" are enclosed in parens
     for (int index = 0; index < 2; index++) {
         Console.Out.WriteLine("hello!");
     }
     return results;
 }
 // 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 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)
 {
     NewLine();
     foreach (Violation violation in violations) {
         toResults.Add(violation);
     }
 }
 // Method Declaration does not end on same line
 public Results CheckFile(string filename, 
     object blam)
 {
     Results results = new Results(filename);
     return results;
 }
 public void ReportViolations(Results toResults)
 {
     foreach (Violation violation in violations) {
         toResults.Add(violation);
     }
 }
        // From ContextHandler
        public Results DoClose(string fileName)
        {
            Results results = new Results(fileName);

            foreach (IRule rule in rules) {
                rule.Close(this);
            }

            ReportViolations(results);
            return results;
        }
 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 Results CheckFile(string filename)
 {
     // this will fail as it has two ";"
     Results results = new Results(filename); return results;
 }
 public abstract void ReportViolations(Results toResults);
 public override void ReportViolations(Results toResults)
 {
     if (Constants.ALLOWABLE_LINES_PER_FILE < myCodeLenght) {
         toResults.Add(CompilationUnitTooLong());
     }
 }
 protected void TearDown()
 {
     ruleChecker = null;
     results = null;
     context = null;
 }
 protected void SetUp()
 {
     ruleChecker = new WidthRule();
     results = new Results(TEST_FILENAME);
     context = new Context();
 }
 protected void TearDown()
 {
     checker = null;
     filename = null;
     results = null;
 }
 protected void CallCheck(string filename)
 {
     this.filename = filename;
     results = checker.CheckFile(filename);
 }
 public override void ReportViolations(Results toResults)
 {
     if (myLines > 700) {
         toResults.Add(Violation.CompilationUnitTooLong(fileName, myLines));
     }
 }