ATMLCommonLibrary.controls.awb.AWBTabControl.CheckForErrors C# (CSharp) Method

CheckForErrors() private static method

private static CheckForErrors ( ICollection controls ) : bool
controls ICollection
return bool
        private static bool CheckForErrors( ICollection controls )
        {
            bool hasError = false;
            foreach (Control control in controls )
            {
                PropertyInfo pi = control.GetType().GetProperty( "HasErrors" );
                if (pi != null )
                {
                    object obj = pi.GetValue( control, null );
                    if( obj is bool )
                        hasError |= (bool)obj;
                }
                hasError |= CheckForErrors( control.Controls );
                if (hasError)
                    break;
            }
            return hasError;
        }