public Warning ( int code, int level, Mono.CSharp.Location loc, string message ) : void | ||
code | int | |
level | int | |
loc | Mono.CSharp.Location | |
message | string | |
return | void |
using Mono.CSharp; // ... var report = new Report(new ConsoleReportPrinter()); report.ReportWarning(1, 5, "Unused variable 'x'");
using Mono.CSharp; // ... var report = new Report(new ConsoleReportPrinter()); foreach (var file in Directory.GetFiles("src", "*.cs")) { var text = File.ReadAllText(file); var context = new CompilerContext(new CompilerSettings(), report); var evaluator = new Evaluator(context); evaluator.Run(text); }This example uses the `Report` object in conjunction with an `Evaluator` object to report warnings during the execution of C# code. The code reads all C# files in the `src` directory, compiles them using an `Evaluator`, and outputs any warnings using the `Report` object. The Mono.CSharp package library is part of the Mono framework and can be downloaded from the Mono website.
public Warning ( int code, int level, Mono.CSharp.Location loc, string message ) : void | ||
code | int | |
level | int | |
loc | Mono.CSharp.Location | |
message | string | |
return | void |