293 {
294 if ((attributes & ~MethodAttributes.MemberAccessMask) != MethodAttributes.Static)
295 {
296 throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags);
297 }
298 if ((attributes & MethodAttributes.MemberAccessMask) != MethodAttributes.Public)
299 {
300 throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags);
301 }
302 if (callingConvention != CallingConventions.Standard && callingConvention != CallingConventions.VarArgs)
303 {
304 throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags);
305 }
306 if (callingConvention == CallingConventions.VarArgs)
307 {
308 throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags);
309 }
310 }