Fix GetConsumingEnumerable exception handling in BlockingCollection
[mono.git] / mcs / class / System / System.Web / AspNetHostingPermissionAttribute.cs
index e823367c59c06115fbf2d440f9335640825b5cd8..80b59455f3e705ff141aa6ac1354a9cf2657f985 100644 (file)
@@ -5,7 +5,7 @@
 //     Andreas Nahr (ClassDevelopment@A-SoftTech.com)
 //     Sebastien Pouliot  <sebastien@ximian.com>
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 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
@@ -58,7 +58,7 @@ namespace System.Web {
                public AspNetHostingPermissionLevel Level {
                        get { return _level; }
                        set {
-                               if (!Enum.IsDefined (typeof (AspNetHostingPermissionLevel), value)) {
+                               if ((value < AspNetHostingPermissionLevel.None) || (value > AspNetHostingPermissionLevel.Unrestricted)) {
                                        string msg = Locale.GetText ("Invalid enum {0}.");
                                        throw new ArgumentException (String.Format (msg, value), "Level");
                                }