Author: spouliot
Date: 2008-01-03 08:50:21 -0500 (Thu, 03 Jan 2008)
New Revision: 92172

Modified:
   trunk/cecil/gendarme/framework/ChangeLog
   trunk/cecil/gendarme/framework/Runner.cs
   trunk/cecil/gendarme/framework/Violation.cs
   trunk/cecil/gendarme/framework/Violations.cs
Log:
2008-01-03  Sebastien Pouliot  <[EMAIL PROTECTED]> 

        * Runner.cs: renamed Violation[s|Collection] and change some methods
        to static (fix warnings)
        * Violation.cs: Don't expose public fields (fix warning)
        * Violations.cs: Rename class to ViolationCollection (fix warning)



Modified: trunk/cecil/gendarme/framework/ChangeLog
===================================================================
--- trunk/cecil/gendarme/framework/ChangeLog    2008-01-03 13:28:39 UTC (rev 
92171)
+++ trunk/cecil/gendarme/framework/ChangeLog    2008-01-03 13:50:21 UTC (rev 
92172)
@@ -1,3 +1,10 @@
+2008-01-03  Sebastien Pouliot  <[EMAIL PROTECTED]> 
+
+       * Runner.cs: renamed Violation[s|Collection] and change some methods
+       to static (fix warnings)
+       * Violation.cs: Don't expose public fields (fix warning)
+       * Violations.cs: Rename class to ViolationCollection (fix warning)
+
 2008-01-02  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * Location.cs: Store the offset (not a constant)

Modified: trunk/cecil/gendarme/framework/Runner.cs
===================================================================
--- trunk/cecil/gendarme/framework/Runner.cs    2008-01-03 13:28:39 UTC (rev 
92171)
+++ trunk/cecil/gendarme/framework/Runner.cs    2008-01-03 13:50:21 UTC (rev 
92172)
@@ -38,8 +38,8 @@
        public abstract class Runner {
 
                private Rules rules;
-               private Violations violations;
-               private static MessageCollection failure = new 
MessageCollection();
+               private ViolationCollection violations;
+               private static MessageCollection failure = new 
MessageCollection ();
                protected bool debug = false;
 
                public Rules Rules {
@@ -50,10 +50,10 @@
                        }
                }
 
-               public Violations Violations {
+               public ViolationCollection Violations {
                        get {
                                if (violations == null)
-                                       violations = new Violations ();
+                                       violations = new ViolationCollection ();
                                return violations;
                        }
                }
@@ -76,12 +76,12 @@
                        }
                }
 
-               private IRule CreateRuleFromType (Type type)
+               private static IRule CreateRuleFromType (Type type)
                {
                        return (IRule) Activator.CreateInstance (type);
                }
 
-               private bool IsContainedInRuleSet (string rule, string mask)
+               private static bool IsContainedInRuleSet (string rule, string 
mask)
                {
                        string[] ruleSet = mask.Split ('|');
                        foreach (string entry in ruleSet) {
@@ -115,7 +115,7 @@
                        return total;
                }
 
-               void LoadRules (Type rule, Type type, RuleCollection rules, ref 
int count)
+               static void LoadRules (Type rule, Type type, RuleCollection 
rules, ref int count)
                {
                        if (!rule.IsAssignableFrom (type))
                                return;

Modified: trunk/cecil/gendarme/framework/Violation.cs
===================================================================
--- trunk/cecil/gendarme/framework/Violation.cs 2008-01-03 13:28:39 UTC (rev 
92171)
+++ trunk/cecil/gendarme/framework/Violation.cs 2008-01-03 13:50:21 UTC (rev 
92172)
@@ -4,7 +4,7 @@
 // Authors:
 //     Sebastien Pouliot <[EMAIL PROTECTED]>
 //
-// Copyright (C) 2005-2006 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2006,2008 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -27,22 +27,22 @@
 //
 
 using System;
-using System.Collections;
 
 using Mono.Cecil;
 
 namespace Gendarme.Framework {
 
        public struct Violation {
-               public IRule Rule;
-               public object Violator;
-               public MessageCollection Messages;
 
+               private IRule rule;
+               private object violator;
+               private MessageCollection messages;
+
                public Violation (IRule rule, object violator, 
MessageCollection messages)
                {
-                       Rule = rule;
-                       Violator = violator;
-                       Messages = messages;
+                       this.rule = rule;
+                       this.violator = violator;
+                       this.messages = messages;
                }
 
                public AssemblyDefinition Assembly {
@@ -66,5 +66,17 @@
                                return null;
                        }
                }
+
+               public MessageCollection Messages {
+                       get { return messages; }
+               }
+
+               public IRule Rule {
+                       get { return rule; }
+               }
+
+               public object Violator {
+                       get { return violator; }
+               }
        }
 }

Modified: trunk/cecil/gendarme/framework/Violations.cs
===================================================================
--- trunk/cecil/gendarme/framework/Violations.cs        2008-01-03 13:28:39 UTC 
(rev 92171)
+++ trunk/cecil/gendarme/framework/Violations.cs        2008-01-03 13:50:21 UTC 
(rev 92172)
@@ -5,7 +5,7 @@
 //     Sebastien Pouliot <[EMAIL PROTECTED]>
 //     Christian Birkl <[EMAIL PROTECTED]>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005, 2008 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,11 +32,11 @@
 
 namespace Gendarme.Framework {
 
-       public class Violations : IEnumerable {
+       public class ViolationCollection : IEnumerable {
 
                private ArrayList list;
 
-               internal Violations ()
+               internal ViolationCollection ()
                {
                }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to