2 using System.Collections.Generic;
\r
6 namespace Mono.CodeContracts.Rewrite {
\r
8 public class RewriterResults {
\r
10 internal static RewriterResults Warning (string warning)
\r
12 return new RewriterResults (new [] { warning }, null);
\r
15 internal static RewriterResults Error (string error)
\r
17 return new RewriterResults (null, new [] { error });
\r
20 internal RewriterResults (ICollection<string> warnings, ICollection<string> errors)
\r
22 this.warnings = warnings;
\r
23 this.errors = errors;
\r
26 private ICollection<string> warnings, errors;
\r
28 public bool AnyWarnings
\r
32 return this.warnings != null && this.warnings.Count > 0;
\r
36 public bool AnyErrors
\r
40 return this.errors != null && this.errors.Count > 0;
\r
44 public IEnumerable<string> Warnings
\r
48 return this.warnings ?? Enumerable.Empty<string> ();
\r
52 public IEnumerable<string> Errors
\r
56 return this.errors ?? Enumerable.Empty<string> ();
\r