public override bool CheckValidity( string routeName, IActivityMonitor monitor )
{
if( monitor == null ) throw new ArgumentNullException( "monitor" );
bool result = true;
for( int i = 0; i < _children.Count; ++i )
{
var child = _children[i];
bool validChild = true;
for( int j = ++i; j < _children.Count; ++j )
{
if( _children[j].Name == child.Name )
{
monitor.SendLine( LogLevel.Error, string.Format( "Duplicate action name '{0}' in {1} '{2}', route '{3}'.", child.Name, TypeDisplayName, Name, routeName ), null );
validChild = false;
}
}
validChild &= child.CheckValidity( routeName, monitor );
// Remove child to continue the process but avoid cascading errors.
if( !validChild ) _children.RemoveAt( i-- );
result &= validChild;
}
return result;
}