private static void InheritanceDemandSecurityException (int securityViolation, Assembly a, Type t, MethodInfo method)
{
string message = null;
AssemblyName an = null;
PermissionSet granted = null;
PermissionSet refused = null;
if (a != null) {
an = a.UnprotectedGetName ();
granted = a.GrantedPermissionSet;
refused = a.DeniedPermissionSet;
}
switch (securityViolation) {
case 1: // MONO_METADATA_INHERITANCEDEMAND_CLASS
message = String.Format (Locale.GetText ("Class inheritance refused for {0}."), t);
break;
case 2: // MONO_METADATA_INHERITANCEDEMAND_CLASS
message = Locale.GetText ("Method override refused.");
break;
default:
message = Locale.GetText ("Load time InheritDemand failed.");
break;
}
throw new SecurityException (message, an, granted, refused, method, SecurityAction.InheritanceDemand, null, null, null);
}