Переглянути джерело

2010-01-19 Rodrigo Kumpera <[email protected]>

	* EventOnTypeBuilderInst.cs: Fix build.

svn path=/trunk/mcs/; revision=149828
Rodrigo Kumpera 16 роки тому
батько
коміт
5f6e5d0806

+ 4 - 0
mcs/class/corlib/System.Reflection.Emit/ChangeLog

@@ -1,3 +1,7 @@
+2010-01-19 Rodrigo Kumpera  <[email protected]>
+
+	* EventOnTypeBuilderInst.cs: Fix build.
+
 2010-01-03  Zoltan Varga  <[email protected]>
 
 	* ILGenerator.cs (Emit): Disallow byref types. Fixes #564411.

+ 12 - 0
mcs/class/corlib/System.Reflection.Emit/EventOnTypeBuilderInst.cs

@@ -113,16 +113,28 @@ namespace System.Reflection.Emit
 
 		public override bool IsDefined (Type attributeType, bool inherit)
 		{
+			if (!instantiation.IsCompilerContext)
+				throw new NotSupportedException ();
+			if (event_info != null)
+				return event_info.IsDefined (attributeType, inherit);
 			throw new NotSupportedException ();
 		}
 
 		public override object [] GetCustomAttributes (bool inherit)
 		{
+			if (!instantiation.IsCompilerContext)
+				throw new NotSupportedException ();
+			if (event_info != null)
+				return event_info.GetCustomAttributes (inherit);
 			throw new NotSupportedException ();
 		}
 
 		public override object [] GetCustomAttributes (Type attributeType, bool inherit)
 		{
+			if (!instantiation.IsCompilerContext)
+				throw new NotSupportedException ();
+			if (event_info != null)
+				return event_info.GetCustomAttributes (attributeType, inherit);
 			throw new NotSupportedException ();
 		}
 	}