diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2008-11-20 06:24:01 +0300 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2008-11-20 06:24:01 +0300 |
commit | 48273817a64827f3ffbc58ca08be83862a730e46 (patch) | |
tree | a3caac6bfbab17b6c039b0225904e4086c02f063 | |
parent | c3b5514f1937e2acaeabaf0141f41ff5065ded54 (diff) |
2008-11-19 Sebastien Pouliot <sebastien@ximian.com>
* NamespaceEngine.cs: Add Exists method to check the existance of
a namespace withint the assembly set.
svn path=/trunk/mono-tools/; revision=119409
-rw-r--r-- | gendarme/framework/Gendarme.Framework.Engines/ChangeLog | 5 | ||||
-rw-r--r-- | gendarme/framework/Gendarme.Framework.Engines/NamespaceEngine.cs | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gendarme/framework/Gendarme.Framework.Engines/ChangeLog b/gendarme/framework/Gendarme.Framework.Engines/ChangeLog index cc692b65..65aa2408 100644 --- a/gendarme/framework/Gendarme.Framework.Engines/ChangeLog +++ b/gendarme/framework/Gendarme.Framework.Engines/ChangeLog @@ -1,3 +1,8 @@ +2008-11-19 Sebastien Pouliot <sebastien@ximian.com> + + * NamespaceEngine.cs: Add Exists method to check the existance of + a namespace withint the assembly set. + 2008-10-28 Sebastien Pouliot <sebastien@ximian.com> * NamespaceEngine.cs: Handle null arguments for [Namespaces|Types] diff --git a/gendarme/framework/Gendarme.Framework.Engines/NamespaceEngine.cs b/gendarme/framework/Gendarme.Framework.Engines/NamespaceEngine.cs index e54a33fc..27eed66a 100644 --- a/gendarme/framework/Gendarme.Framework.Engines/NamespaceEngine.cs +++ b/gendarme/framework/Gendarme.Framework.Engines/NamespaceEngine.cs @@ -83,6 +83,19 @@ namespace Gendarme.Framework.Engines { } /// <summary> + /// Return if a namespace exist inside the assembly set + /// </summary> + /// <param name="nameSpace">Namespace to confirm existance</param> + /// <returns>True if the namespace exists, False otherwise</returns> + public static bool Exists (string nameSpace) + { + if (nameSpace == null) + throw new ArgumentNullException ("nameSpace"); + + return namespaces.ContainsKey (nameSpace); + } + + /// <summary> /// Return all namespaces defined inside the specified assembly. /// </summary> /// <param name="assembly">Assembly to search into</param> |