private ArrayList GenericResolve(Evidence evidence, out bool allConst)
{
CodeGroupStack stack = new CodeGroupStack();
CodeGroup rootCodeGroup = this.m_rootCodeGroup;
if (rootCodeGroup == null)
{
throw new PolicyException(Environment.GetResourceString("Policy_NonFullTrustAssembly"));
}
CodeGroupStackFrame element = new CodeGroupStackFrame {
current = rootCodeGroup,
parent = null
};
stack.Push(element);
ArrayList list = new ArrayList();
bool flag = false;
allConst = true;
Exception exception = null;
while (!stack.IsEmpty())
{
element = stack.Pop();
FirstMatchCodeGroup current = element.current as FirstMatchCodeGroup;
UnionCodeGroup group3 = element.current as UnionCodeGroup;
if (!(element.current.MembershipCondition is IConstantMembershipCondition) || ((group3 == null) && (current == null)))
{
allConst = false;
}
try
{
element.policy = PolicyManager.ResolveCodeGroup(element.current, evidence);
}
catch (Exception exception2)
{
if (exception == null)
{
exception = exception2;
}
}
if (element.policy != null)
{
if ((element.policy.Attributes & PolicyStatementAttribute.Exclusive) != PolicyStatementAttribute.Nothing)
{
if (flag)
{
throw new PolicyException(Environment.GetResourceString("Policy_MultipleExclusive"));
}
list.RemoveRange(0, list.Count);
list.Add(element);
flag = true;
}
if (!flag)
{
list.Add(element);
}
}
}
if (exception != null)
{
throw exception;
}
return list;
}