private Control PerformValidation (ContainerControl top_container, bool postpone_validation, ArrayList validation_chain,
Control topmost_under_root)
{
validation_failed = false;
if (postpone_validation) {
AddValidationChain (top_container, validation_chain);
return null;
}
// if not null, pending chain has always one element or more
if (top_container.pending_validation_chain != null) {
// if the topmost node in the enter chain is exactly the topmost
// int the validation chain, remove it, as .net does
int last_idx = top_container.pending_validation_chain.Count - 1;
if (topmost_under_root == top_container.pending_validation_chain [last_idx])
top_container.pending_validation_chain.RemoveAt (last_idx);
AddValidationChain (top_container, validation_chain);
validation_chain = top_container.pending_validation_chain;
top_container.pending_validation_chain = null;
}
for (int i = 0; i < validation_chain.Count; i ++) {
if (!ValidateControl ((Control)validation_chain[i])) {
validation_failed = true;
return (Control)validation_chain[i];
}
}
return null;
}