System.MonoType.CheckMethodSecurity C# (CSharp) Method

CheckMethodSecurity() private method

private CheckMethodSecurity ( MethodBase mb ) : MethodBase
mb System.Reflection.MethodBase
return System.Reflection.MethodBase
		private MethodBase CheckMethodSecurity (MethodBase mb)
		{
#if NET_2_1
			return mb;
#else
			if (!SecurityManager.SecurityEnabled || (mb == null))
				return mb;

			// Sadly we have no way to know which kind of security action this is
			// so we must do it the hard way. Actually this isn't so bad 
			// because we can skip the (mb.Attributes & MethodAttributes.HasSecurity)
			// icall required (and do it ourselves)

			// this (unlike the Invoke step) is _and stays_ a LinkDemand (caller)
			return SecurityManager.ReflectedLinkDemandQuery (mb) ? mb : null;
#endif
		}