Ver código fonte

2003-12-24 Ben Maurer <[email protected]>

	* Type.cs (IsNotPublic): One would normally assume that
	IsNotPublic == !IsPublic, but this is not the case (note to MS,
	make better names ;-). Fixes #52547, `Type.IsNotPublic not
	correct for Nested types'

svn path=/trunk/mcs/; revision=21482
Ben Maurer 22 anos atrás
pai
commit
58df5bc175

+ 7 - 0
mcs/class/corlib/System/ChangeLog

@@ -1,3 +1,10 @@
+2003-12-24 Ben Maurer  <[email protected]>
+
+	* Type.cs (IsNotPublic): One would normally assume that
+	IsNotPublic == !IsPublic, but this is not the case (note to MS,
+	make better names ;-). Fixes #52547, `Type.IsNotPublic not 
+	correct for Nested types'
+
 2003-12-24  Nick Drochak  <[email protected]>
 
 	* Array.cs (CreateInstance): Throw NullRef exception like .NET 1.1, 

+ 1 - 1
mcs/class/corlib/System/Type.cs

@@ -265,7 +265,7 @@ namespace System {
 
 		public bool IsNotPublic {
 			get {
-				return !IsPublic;
+				return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NotPublic;
 			}
 		}