internal void DemandChoice ()
{
SecurityException exception = null;
bool result = false;
foreach (PermissionSet pset in _list) {
try {
pset.Demand ();
result = true;
break;
}
catch (SecurityException se) {
// keep the first failure, we may throw it if we not succeed
if (exception == null)
exception = se;
}
}
if (!result) {
if (exception != null)
throw exception;
else
throw new SecurityException ("DemandChoice failed.");
}
}